diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-08-24 21:11:43 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-08-24 21:11:43 +0000 |
commit | b09db225aaadcaa1fad202d416c75b1d60ad6aa8 (patch) | |
tree | 404e67b6a69cf96843d9ffe894006c3d8ff2301b /clang/lib/AST/Comment.cpp | |
parent | 6d03d84fac57c1ff6ce29acfe028b19a3e639ff7 (diff) | |
download | bcm5719-llvm-b09db225aaadcaa1fad202d416c75b1d60ad6aa8.tar.gz bcm5719-llvm-b09db225aaadcaa1fad202d416c75b1d60ad6aa8.zip |
[Sema][Comments] Support @param with c++ 'using' keyword
Give appropriate warnings with -Wdocumentation for @param comments
that refer to function aliases defined with 'using'. Very similar
to typedef's behavior. This does not add support for
TypeAliasTemplateDecl yet.
Differential Revision: https://reviews.llvm.org/D23783
rdar://problem/27300695
llvm-svn: 279662
Diffstat (limited to 'clang/lib/AST/Comment.cpp')
-rw-r--r-- | clang/lib/AST/Comment.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/Comment.cpp b/clang/lib/AST/Comment.cpp index f88e9e212e3..89a7b7fa902 100644 --- a/clang/lib/AST/Comment.cpp +++ b/clang/lib/AST/Comment.cpp @@ -226,12 +226,15 @@ void DeclInfo::fill() { case Decl::Namespace: Kind = NamespaceKind; break; + case Decl::TypeAlias: case Decl::Typedef: { Kind = TypedefKind; - // If this is a typedef to something we consider a function, extract + // If this is a typedef / using to something we consider a function, extract // arguments and return type. - const TypedefDecl *TD = cast<TypedefDecl>(CommentDecl); - const TypeSourceInfo *TSI = TD->getTypeSourceInfo(); + const TypeSourceInfo *TSI = + K == Decl::Typedef + ? cast<TypedefDecl>(CommentDecl)->getTypeSourceInfo() + : cast<TypeAliasDecl>(CommentDecl)->getTypeSourceInfo(); if (!TSI) break; TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc(); @@ -302,9 +305,6 @@ void DeclInfo::fill() { } break; } - case Decl::TypeAlias: - Kind = TypedefKind; - break; case Decl::TypeAliasTemplate: { const TypeAliasTemplateDecl *TAT = cast<TypeAliasTemplateDecl>(CommentDecl); Kind = TypedefKind; |