diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2017-04-27 07:11:09 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2017-04-27 07:11:09 +0000 |
commit | 74bc51fffa47a16910538bc195068c2ac2e49bd8 (patch) | |
tree | f7b2170fbb65443046fbd0cd818707673e7b531c /lib/AST/ExprConstant.cpp | |
parent | 6b7fb45df342132973cf828b5802da7cc50838c6 (diff) |
In the expression evaluator, descend into both the true and false expressions of a ConditionalOperator when the condition can't be evaluated and we're in an evaluation mode that says we should continue evaluating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 2fafa48767..5c5b3daf70 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -4418,8 +4418,14 @@ private: bool HandleConditionalOperator(const ConditionalOperator *E) { bool BoolResult; if (!EvaluateAsBooleanCondition(E->getCond(), BoolResult, Info)) { - if (Info.checkingPotentialConstantExpression() && Info.noteFailure()) + if (Info.checkingPotentialConstantExpression() && Info.noteFailure()) { CheckPotentialConstantConditional(E); + return false; + } + if (Info.noteFailure()) { + StmtVisitorTy::Visit(E->getTrueExpr()); + StmtVisitorTy::Visit(E->getFalseExpr()); + } return false; } |