Index: lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/ExprEngine.cpp +++ lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1380,6 +1380,12 @@ return Condition; } + if (I == E) { + const Stmt *TC = B->getTerminatorCondition(); + assert(TC); + return TC; + } + assert(I != E); while (Condition) { Index: test/Analysis/temporaries.cpp =================================================================== --- test/Analysis/temporaries.cpp +++ test/Analysis/temporaries.cpp @@ -118,13 +118,11 @@ extern bool coin(); extern bool check(const Dtor &); -#ifndef TEMPORARY_DTORS // FIXME: Don't assert here when tmp dtors are enabled. // PR16664 and PR18159 if (coin() && (coin() || coin() || check(Dtor()))) { Dtor(); } -#endif } #ifdef TEMPORARY_DTORS @@ -170,17 +168,17 @@ clang_analyzer_eval(true); // no warning, unreachable code } -/* + // PR16664 and PR18159 - FIXME: Don't assert here. + //FIXME: Don't assert here. void testConsistencyNested(int i) { extern bool compute(bool); if (i == 5 && (i == 4 || i == 5 || check(NoReturnDtor()))) - clang_analyzer_eval(true); // expected TRUE + clang_analyzer_eval(true); // expected-warning{{TRUE}} if (i == 5 && (i == 4 || i == 5 || check(NoReturnDtor()))) - clang_analyzer_eval(true); // expected TRUE + clang_analyzer_eval(true); // expected-warning{{TRUE}} if (i != 5) return; @@ -189,17 +187,18 @@ (i == 4 || compute(true) || compute(i == 5 && (i == 4 || check(NoReturnDtor()))))) || i != 4) { - clang_analyzer_eval(true); // expected TRUE + clang_analyzer_eval(true); // expected-warning{{TRUE}} } - FIXME: This shouldn't cause a warning. - if (compute(i == 5 && + //FIXME: This shouldn't cause a warning. + if (check(NoReturnDtor()) && + compute(i == 5 && (i == 4 || i == 4 || compute(i == 5 && (i == 4 || check(NoReturnDtor()))))) || i != 4) { clang_analyzer_eval(true); // no warning, unreachable code } - }*/ + } // PR16664 and PR18159 void testConsistencyNestedSimple(bool value) {