diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-04-26 12:46:27 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-04-26 12:46:27 +0000 |
commit | 6246cc6c0ebbb95eb74ffdbc2004b7d0f83c74da (patch) | |
tree | c2d32904ff938cfcd4d6e96236d4f370dfef2cee /clang/lib/AST/Comment.cpp | |
parent | ad06391ca98085a5245ac2fec6cccae23d3a1089 (diff) | |
download | bcm5719-llvm-6246cc6c0ebbb95eb74ffdbc2004b7d0f83c74da.tar.gz bcm5719-llvm-6246cc6c0ebbb95eb74ffdbc2004b7d0f83c74da.zip |
[AST] Look through attribute type locs when searching for function type
loc
Prior to this commit -Wdocumentation crashed when checking the @returns command
for declarations whose function/block pointer type included an attribute like
_Nullable.
rdar://31818195
llvm-svn: 301400
Diffstat (limited to 'clang/lib/AST/Comment.cpp')
-rw-r--r-- | clang/lib/AST/Comment.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/Comment.cpp b/clang/lib/AST/Comment.cpp index 20ff2430df2..dfa2a1665d4 100644 --- a/clang/lib/AST/Comment.cpp +++ b/clang/lib/AST/Comment.cpp @@ -116,6 +116,9 @@ bool ParagraphComment::isWhitespaceNoCache() const { static TypeLoc lookThroughTypedefOrTypeAliasLocs(TypeLoc &SrcTL) { TypeLoc TL = SrcTL.IgnoreParens(); + // Look through attribute types. + if (AttributedTypeLoc AttributeTL = TL.getAs<AttributedTypeLoc>()) + return AttributeTL.getModifiedLoc(); // Look through qualified types. if (QualifiedTypeLoc QualifiedTL = TL.getAs<QualifiedTypeLoc>()) return QualifiedTL.getUnqualifiedLoc(); |