From: NAKAMURA Takumi Date: Sun, 27 Jan 2013 11:09:41 +0000 (+0000) Subject: Revert r173586 (and r173587) , "Attach any tag type's documentation to its typedef if" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06b5ea65365c5898be8355868a49c6f396cc8b02;p=clang Revert r173586 (and r173587) , "Attach any tag type's documentation to its typedef if" It caused unexpected warnings with @tparam. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173614 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 1539b00939..7ba64e32f3 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -428,12 +428,12 @@ comments::FullComment *ASTContext::getCommentForDecl( return cloneFullComment(FC, D); } else if (const TypedefDecl *TD = dyn_cast(D)) { - // Attach any tag type's documentation to its typedef if latter + // Attach enum's documentation to its typedef if latter // does not have one of its own. QualType QT = TD->getUnderlyingType(); - if (const TagType *TT = QT->getAs()) - if (const Decl *TD = TT->getDecl()) - if (comments::FullComment *FC = getCommentForDecl(TD, PP)) + if (const EnumType *ET = QT->getAs()) + if (const EnumDecl *ED = ET->getDecl()) + if (comments::FullComment *FC = getCommentForDecl(ED, PP)) return cloneFullComment(FC, D); } return NULL; diff --git a/test/Index/annotate-comments-typedef.m b/test/Index/annotate-comments-typedef.m index 784c51ec8c..6e5fb73520 100644 --- a/test/Index/annotate-comments-typedef.m +++ b/test/Index/annotate-comments-typedef.m @@ -28,9 +28,3 @@ enum E { }; typedef enum E E_T; // CHECK: TypedefDecl=E_T:[[@LINE-1]]:16 (Definition) FullCommentAsHTML=[

Documentation for E

] FullCommentAsXML=[Ec:@E@Etypedef enum E E_T Documentation for E ] - -/** Comment about Foo */ -typedef struct { - int iii; - } Foo; -// CHECK: TypedefDecl=Foo:[[@LINE-1]]:11 (Definition) FullCommentAsHTML=[

Comment about Foo

] FullCommentAsXML=[<anonymous>c:@SA@Footypedef struct Foo Foo Comment about Foo ]