diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-10-06 20:51:04 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-10-06 20:51:04 +0000 |
commit | e9baea817822ec183f521c444b37d257aabbc655 (patch) | |
tree | e40c9f85f9af79699cc79de10fba77bcd6dd5bbc /clang/lib/AST/CommentSema.cpp | |
parent | 214babea606fae2ad1e367866e8394cf1b211c60 (diff) | |
download | bcm5719-llvm-e9baea817822ec183f521c444b37d257aabbc655.tar.gz bcm5719-llvm-e9baea817822ec183f521c444b37d257aabbc655.zip |
-Wdocumentation should allow '...' params in variadic function type aliases
rdar://34811344
llvm-svn: 315103
Diffstat (limited to 'clang/lib/AST/CommentSema.cpp')
-rw-r--r-- | clang/lib/AST/CommentSema.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index 403454d3ab7..6c2019e1a72 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/lib/AST/CommentSema.cpp @@ -813,7 +813,7 @@ bool Sema::isAnyFunctionDecl() { } bool Sema::isFunctionOrMethodVariadic() { - if (!isAnyFunctionDecl() && !isObjCMethodDecl() && !isFunctionTemplateDecl()) + if (!isFunctionDecl() || !ThisDeclInfo->CurrentDecl) return false; if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(ThisDeclInfo->CurrentDecl)) @@ -824,6 +824,14 @@ bool Sema::isFunctionOrMethodVariadic() { if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(ThisDeclInfo->CurrentDecl)) return MD->isVariadic(); + if (const TypedefNameDecl *TD = + dyn_cast<TypedefNameDecl>(ThisDeclInfo->CurrentDecl)) { + QualType Type = TD->getUnderlyingType(); + if (Type->isFunctionPointerType() || Type->isBlockPointerType()) + Type = Type->getPointeeType(); + if (const auto *FT = Type->getAs<FunctionProtoType>()) + return FT->isVariadic(); + } return false; } |