diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index fe0cf74496..e9faba6e6b 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -3390,10 +3390,10 @@ bool LocalTypedefNameReferencer::VisitRecordType(const RecordType *RT) { } TypeLoc Sema::getReturnTypeLoc(FunctionDecl *FD) const { - return FD->getTypeSourceInfo() - ->getTypeLoc() - .getAsAdjusted<FunctionProtoTypeLoc>() - .getReturnLoc(); + TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc().IgnoreParens(); + while (auto ATL = TL.getAs<AttributedTypeLoc>()) + TL = ATL.getModifiedLoc().IgnoreParens(); + return TL.castAs<FunctionProtoTypeLoc>().getReturnLoc(); } /// Deduce the return type for a function from a returned expression, per |