Add the FullExprArg wrapper and use it for if statement conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71982 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index d59443b..5c04c24 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -180,17 +180,19 @@
}
Action::OwningStmtResult
-Sema::ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal,
+Sema::ActOnIfStmt(SourceLocation IfLoc, FullExprArg CondVal,
StmtArg ThenVal, SourceLocation ElseLoc,
StmtArg ElseVal) {
- Expr *condExpr = CondVal.takeAs<Expr>();
+ OwningExprResult CondResult(CondVal.release());
+
+ Expr *condExpr = CondResult.takeAs<Expr>();
assert(condExpr && "ActOnIfStmt(): missing expression");
if (!condExpr->isTypeDependent()) {
DefaultFunctionArrayConversion(condExpr);
// Take ownership again until we're past the error checking.
- CondVal = condExpr;
+ CondResult = condExpr;
QualType condType = condExpr->getType();
if (getLangOptions().CPlusPlus) {
@@ -213,7 +215,7 @@
Diag(stmt->getSemiLoc(), diag::warn_empty_if_body);
}
- CondVal.release();
+ CondResult.release();
return Owned(new (Context) IfStmt(IfLoc, condExpr, thenStmt,
ElseLoc, ElseVal.takeAs<Stmt>()));
}