Skip to content

Commit 73c6f01

Browse files
Update testcondition.cpp
1 parent f3531f1 commit 73c6f01

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testcondition.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4846,6 +4846,15 @@ class TestCondition : public TestFixture {
48464846
"}\n");
48474847
ASSERT_EQUALS("[test.cpp:6:9] -> [test.cpp:9:9]: (warning) Identical condition 'a', second condition is always false [identicalConditionAfterEarlyExit]\n",
48484848
errout_str());
4849+
4850+
check("bool b() { return false; }\n" // #10452
4851+
"void f() {\n"
4852+
" if (b()) {}\n"
4853+
" if (!b()) {}\n"
4854+
"}\n");
4855+
ASSERT_EQUALS("[test.cpp:3:10]: (style) Condition 'b()' is always false [knownConditionTrueFalse]\n"
4856+
"[test.cpp:4:9]: (style) Condition '!b()' is always true [knownConditionTrueFalse]\n",
4857+
errout_str());
48494858
}
48504859

48514860
void alwaysTrueSymbolic()

0 commit comments

Comments
 (0)