diff options
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index fe0cf744964..e9faba6e6b4 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/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 |