We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 260eb4a commit b571941Copy full SHA for b571941
1 file changed
test/testcondition.cpp
@@ -3087,6 +3087,14 @@ class TestCondition : public TestFixture {
3087
"}");
3088
ASSERT_EQUALS("", errout.str());
3089
3090
+ // #8206 - knownCondition always false
3091
+ check("void f(int i)\n"
3092
+"{\n"
3093
+" if(i > 4)\n"
3094
+" for( int x = 0; i < 3; ++x){}\n" // <<
3095
+"}");
3096
+ ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:4]: (style) Condition 'i<3' is always false\n", errout.str());
3097
+
3098
// Skip literals
3099
check("void f() { if(true) {} }");
3100
0 commit comments