diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 259bda59c..84ecc7bf8 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -3087,6 +3087,14 @@ private: "}"); ASSERT_EQUALS("", errout.str()); + // #8206 - knownCondition always false + check("void f(int i)\n" +"{\n" +" if(i > 4)\n" +" for( int x = 0; i < 3; ++x){}\n" // << +"}"); + ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style) Condition 'i<3' is always false\n", errout.str()); + // Skip literals check("void f() { if(true) {} }"); ASSERT_EQUALS("", errout.str());