[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
This commit is contained in:
Alex Lorenz 2017-04-26 12:46:27 +00:00
parent ad06391ca9
commit 6246cc6c0e
2 changed files with 4 additions and 1 deletions

View File

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

View File

@ -254,7 +254,7 @@ struct HasFields {
* \param p not here.
* \returns integer.
*/
void (^blockPointerVariableThatLeadsNowhere)();
void (^_Nullable blockPointerVariableThatLeadsNowhere)();
@interface CheckFunctionBlockPointerVars {
/**