From: Dmitri Gribenko Date: Sat, 15 Sep 2012 21:13:36 +0000 (+0000) Subject: Comment parsing: don't treat typedef to a typedef to a function as a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec504e0d677594fe975e29b25d6d47be54038baf;p=clang Comment parsing: don't treat typedef to a typedef to a function as a 'function-like' type that can be annotated with \param. Thanks to Eli Friedman for noticing! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163985 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index a6a21f3923..4336885d39 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -253,14 +253,6 @@ void DeclInfo::fill() { TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc(); while (true) { TL = TL.IgnoreParens(); - // Look through typedefs. - if (TypedefTypeLoc *TypedefTL = dyn_cast(&TL)) { - TSI = TypedefTL->getTypedefNameDecl()->getTypeSourceInfo(); - if (TSI) - break; - TL = TSI->getTypeLoc().getUnqualifiedLoc(); - continue; - } // Look through qualified types. if (QualifiedTypeLoc *QualifiedTL = dyn_cast(&TL)) { TL = QualifiedTL->getUnqualifiedLoc(); diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index 2c8207b8ae..649f072ab9 100644 --- a/test/Sema/warn-documentation.cpp +++ b/test/Sema/warn-documentation.cpp @@ -297,6 +297,12 @@ typedef int (* const test_param25)(int aaa, int ccc); /// \returns aaa. typedef int (C::*test_param26)(int aaa, int ccc); +typedef int (*test_param27)(int aaa); + +// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}} +/// \param aaa Meow. +typedef test_param27 test_param28; + // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} /// \tparam T Aaa