Index: lib/AST/ExprConstant.cpp =================================================================== --- lib/AST/ExprConstant.cpp +++ lib/AST/ExprConstant.cpp @@ -4418,8 +4418,14 @@ 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; } Index: test/Sema/integer-overflow.c =================================================================== --- test/Sema/integer-overflow.c +++ test/Sema/integer-overflow.c @@ -148,6 +148,9 @@ a[4608 * 1024 * 1024] = 1i; // expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} + (void)((i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024)) + 1); + +// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}} return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024))); }