Skip to content

Commit 8016585

Browse files
committed
Add test for 13630
1 parent e72577e commit 8016585

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4949,6 +4949,19 @@ class TestCondition : public TestFixture {
49494949
" return x ? false : true;\n"
49504950
"}\n");
49514951
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+
"{\n"
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());
49524965
}
49534966

49544967
void alwaysTrueSymbolic()

0 commit comments

Comments
 (0)