]> granicus.if.org Git - clang/commitdiff
Comment parsing: don't treat typedef to a typedef to a function as a
authorDmitri Gribenko <gribozavr@gmail.com>
Sat, 15 Sep 2012 21:13:36 +0000 (21:13 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Sat, 15 Sep 2012 21:13:36 +0000 (21:13 +0000)
'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

lib/AST/Comment.cpp
test/Sema/warn-documentation.cpp

index a6a21f3923ab45a516d18533434b09a2edf53788..4336885d394cc23ebceb157e0c5503aa80117e30 100644 (file)
@@ -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<TypedefTypeLoc>(&TL)) {
-        TSI = TypedefTL->getTypedefNameDecl()->getTypeSourceInfo();
-        if (TSI)
-          break;
-        TL = TSI->getTypeLoc().getUnqualifiedLoc();
-        continue;
-      }
       // Look through qualified types.
       if (QualifiedTypeLoc *QualifiedTL = dyn_cast<QualifiedTypeLoc>(&TL)) {
         TL = QualifiedTL->getUnqualifiedLoc();
index 2c8207b8aef5095539e72154bcb5df98bf707701..649f072ab97ac5d2f5b6c112f89dce90fd3b24b1 100644 (file)
@@ -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