diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h index 2ef87be13bdc..5c23f9ac6147 100644 --- a/clang/include/clang/Parse/Action.h +++ b/clang/include/clang/Parse/Action.h @@ -551,7 +551,7 @@ public: return StmtEmpty(); } virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp) { + FullExprArg RetValExp) { return StmtEmpty(); } virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc, diff --git a/clang/lib/Frontend/PrintParserCallbacks.cpp b/clang/lib/Frontend/PrintParserCallbacks.cpp index fbac3c88aa34..f02d5d469c64 100644 --- a/clang/lib/Frontend/PrintParserCallbacks.cpp +++ b/clang/lib/Frontend/PrintParserCallbacks.cpp @@ -369,7 +369,7 @@ namespace { return StmtEmpty(); } virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp) { + FullExprArg RetValExp) { Out << __FUNCTION__ << "\n"; return StmtEmpty(); } diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 952c4c15f3bb..758b662a2392 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1071,7 +1071,7 @@ Parser::OwningStmtResult Parser::ParseReturnStatement() { return StmtError(); } } - return Actions.ActOnReturnStmt(ReturnLoc, move(R)); + return Actions.ActOnReturnStmt(ReturnLoc, Actions.FullExpr(R)); } /// FuzzyParseMicrosoftAsmStatement. When -fms-extensions is enabled, this diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 993978166779..b2540ba2e05f 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1215,7 +1215,7 @@ public: Scope *CurScope); virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, - ExprArg RetValExp); + FullExprArg RetValExp); OwningStmtResult ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 1a1362e6699f..879d84e36c67 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -826,8 +826,8 @@ static bool IsReturnCopyElidable(ASTContext &Ctx, QualType RetType, } Action::OwningStmtResult -Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprArg rex) { - Expr *RetValExp = rex.takeAs(); +Sema::ActOnReturnStmt(SourceLocation ReturnLoc, FullExprArg rex) { + Expr *RetValExp = rex->takeAs(); if (CurBlock) return ActOnBlockReturnStmt(ReturnLoc, RetValExp); diff --git a/clang/lib/Sema/SemaTemplateInstantiateStmt.cpp b/clang/lib/Sema/SemaTemplateInstantiateStmt.cpp index 91807c3e6a23..1f69479a0e7c 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateStmt.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateStmt.cpp @@ -130,7 +130,7 @@ TemplateStmtInstantiator::VisitReturnStmt(ReturnStmt *S) { return SemaRef.StmtError(); } - return SemaRef.ActOnReturnStmt(S->getReturnLoc(), move(Result)); + return SemaRef.ActOnReturnStmt(S->getReturnLoc(), FullExpr(Result)); } Sema::OwningStmtResult