diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index d59443b2cb..5c04c2491f 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -180,17 +180,19 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II, } 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 @@ Sema::ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal, Diag(stmt->getSemiLoc(), diag::warn_empty_if_body); } - CondVal.release(); + CondResult.release(); return Owned(new (Context) IfStmt(IfLoc, condExpr, thenStmt, ElseLoc, ElseVal.takeAs<Stmt>())); } |