summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 82c461128dd..0fe46ed607b 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -1491,10 +1491,8 @@ Action::OwningExprResult Sema::CheckConditionVariable(VarDecl *ConditionVar,
Expr *Condition = DeclRefExpr::Create(Context, 0, SourceRange(), ConditionVar,
ConditionVar->getLocation(),
ConditionVar->getType().getNonReferenceType());
- if (ConvertToBoolean && CheckBooleanCondition(Condition, StmtLoc)) {
- Condition->Destroy(Context);
+ if (ConvertToBoolean && CheckBooleanCondition(Condition, StmtLoc))
return ExprError();
- }
return Owned(Condition);
}
OpenPOWER on IntegriCloud