Skip to content

Commit

Permalink
Update testcondition.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored May 13, 2024
1 parent b06ae86 commit 7f68d69
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/testcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,15 @@ class TestCondition : public TestFixture {
" bool m_value = false;\n"
"};");
ASSERT_EQUALS("", errout_str());

// #12725
check("bool f(bool b) {\n"
" if (b)\n"
" return !b;\n"
" b = g();\n"
" return b;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:2] -> [test.cpp:3]: (style) Return value '!b' is always false\n", errout_str());
}

void oppositeInnerConditionPointers() {
Expand Down

0 comments on commit 7f68d69

Please sign in to comment.