From: Saleem Abdulrasool Date: Fri, 17 Oct 2014 17:20:33 +0000 (+0000) Subject: Sema: address post-commit review comment X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c92ae038311212165727e5d9b17ce4d1eef8abcf;p=clang Sema: address post-commit review comment Hoist the IgnoreParens so that we ignore it around attributes as well in order to future-proof the code. Addresses Richard's comments for SVN r219974. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220053 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 8a28b29a1c..0c2d9e3e7a 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -2756,10 +2756,10 @@ bool LocalTypedefNameReferencer::VisitRecordType(const RecordType *RT) { } TypeLoc Sema::getReturnTypeLoc(FunctionDecl *FD) const { - TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc(); + TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc().IgnoreParens(); while (auto ATL = TL.getAs()) TL = ATL.getModifiedLoc().IgnoreParens(); - return TL.IgnoreParens().castAs().getReturnLoc(); + return TL.castAs().getReturnLoc(); } /// Deduce the return type for a function from a returned expression, per