1 parent 770eeb9 commit 0e81fcaCopy full SHA for 0e81fca
1 file changed
test/testcondition.cpp
@@ -4911,6 +4911,19 @@ class TestCondition : public TestFixture {
4911
ASSERT_EQUALS("[test.cpp:3:10]: (style) Condition 'b()' is always false [knownConditionTrueFalse]\n"
4912
"[test.cpp:4:9]: (style) Condition '!b()' is always true [knownConditionTrueFalse]\n",
4913
errout_str());
4914
+
4915
+ // #13630
4916
+ check("template <typename Char>\n"
4917
+ "void f0(Char c) {\n"
4918
+ " if (c <= 0) return;\n"
4919
+ " if (c >= 1) {}\n"
4920
+ "}\n"
4921
+ "void g() {\n"
4922
+ " char c = 'A';\n"
4923
+ " f0(c);\n"
4924
+ "}\n");
4925
+ ASSERT_EQUALS("[test.cpp:3:11] -> [test.cpp:4:11]: (style) Condition 'c>=1' is always true [knownConditionTrueFalse]\n",
4926
+ errout_str());
4927
}
4928
4929
void alwaysTrueSymbolic()
0 commit comments