Skip to content

Commit 0e81fca

Browse files
author
Your Name
committed
Add test for 13630
1 parent 770eeb9 commit 0e81fca

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
@@ -4911,6 +4911,19 @@ class TestCondition : public TestFixture {
49114911
ASSERT_EQUALS("[test.cpp:3:10]: (style) Condition 'b()' is always false [knownConditionTrueFalse]\n"
49124912
"[test.cpp:4:9]: (style) Condition '!b()' is always true [knownConditionTrueFalse]\n",
49134913
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());
49144927
}
49154928

49164929
void alwaysTrueSymbolic()

0 commit comments

Comments
 (0)