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: http://review.tizen.org/git/?a=commitdiff_plain;h=69b664dfd7467b9613b0fbc16def83e906d01bbe;p=platform%2Fupstream%2Fllvm.git Revert r173586 (and r173587) , "Attach any tag type's documentation to its typedef if" It caused unexpected warnings with @tparam. llvm-svn: 173614 --- diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 1539b00..7ba64e3 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/test/Index/annotate-comments-typedef.m b/clang/test/Index/annotate-comments-typedef.m index 784c51e..6e5fb73 100644 --- a/clang/test/Index/annotate-comments-typedef.m +++ b/clang/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 ]