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!

llvm-svn: 163985
This commit is contained in:
Dmitri Gribenko 2012-09-15 21:13:36 +00:00
parent 8d30240939
commit 49fdf8d3f5
2 changed files with 6 additions and 8 deletions

View 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();

View 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