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 | 20edee6a3e4f077da25360edebb8180afebb03ed (patch) | |
| tree | 0a12cd32e0f344745c095db07cf5069732d4924c /clang/lib/AST | |
| parent | 0f8f177682ddd91e7fe84595170d8e4986516e3b (diff) | |
| download | bcm5719-llvm-20edee6a3e4f077da25360edebb8180afebb03ed.tar.gz bcm5719-llvm-20edee6a3e4f077da25360edebb8180afebb03ed.zip | |
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.
llvm-svn: 301520
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 2fafa487675..5c5b3daf70c 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/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; } |

