diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 9281961cf..f944cf378 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -4024,6 +4024,13 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'i<=18' is always true\n", errout.str()); + // #8209 + check("void f() {\n" + " for(int x = 0; x < 3; ++x)\n" + " if(x == -5) {}\n" + "}"); + ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'x==-5' is always false\n", errout.str()); + check("void f(unsigned int u1, unsigned int u2) {\n" " if (u1 <= 10 && u2 >= 20) {\n" " if (u1 != u2) {}\n"