From 7f68d69293d1b1646ae324361bc571d555f4dc7b Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 13 May 2024 11:54:16 +0200 Subject: [PATCH] Update testcondition.cpp --- test/testcondition.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index db044308c71..1a535ff0bf0 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -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() {