From 6246cc6c0ebbb95eb74ffdbc2004b7d0f83c74da Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Wed, 26 Apr 2017 12:46:27 +0000 Subject: [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 --- clang/lib/AST/Comment.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/AST/Comment.cpp') 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()) + return AttributeTL.getModifiedLoc(); // Look through qualified types. if (QualifiedTypeLoc QualifiedTL = TL.getAs()) return QualifiedTL.getUnqualifiedLoc(); -- cgit v1.2.3