summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2017-04-27 07:11:09 +0000
committerNick Lewycky <nicholas@mxc.ca>2017-04-27 07:11:09 +0000
commit20edee6a3e4f077da25360edebb8180afebb03ed (patch)
tree0a12cd32e0f344745c095db07cf5069732d4924c /clang/lib
parent0f8f177682ddd91e7fe84595170d8e4986516e3b (diff)
downloadbcm5719-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')
-rw-r--r--clang/lib/AST/ExprConstant.cpp8
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;
}
OpenPOWER on IntegriCloud