1 parent e72577e commit 8016585Copy full SHA for 8016585
1 file changed
test/testcondition.cpp
@@ -4949,6 +4949,19 @@ class TestCondition : public TestFixture {
4949
" return x ? false : true;\n"
4950
"}\n");
4951
ASSERT_EQUALS("", errout_str());
4952
+
4953
+ check("template <typename Char>\n" // deduced template parameter type is integral
4954
+ "void f0(Char c)\n"
4955
+ "{\n"
4956
+ " if (c <= 0) return;\n"
4957
+ " if (c >= 1) {;}\n"
4958
+ "}\n"
4959
+ "void g()\n"
4960
4961
+ " char c = 'A';\n"
4962
+ " f0(c);\n"
4963
+ "}\n");
4964
+ ASSERT_EQUALS("[test.cpp:4:11] -> [test.cpp:5:11]: (style) Condition 'c>=1' is always true [knownConditionTrueFalse]\n", errout_str());
4965
}
4966
4967
void alwaysTrueSymbolic()
0 commit comments