From f7484608b46f5a92722789a0303550626c1ba846 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 15 Sep 2026 20:33:34 +0200 Subject: [PATCH 1/2] Restore warning for #14392 --- lib/checkcondition.cpp | 3 ++- test/testcondition.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index be7ce2d0232..2fc9843da23 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -1571,7 +1571,8 @@ void CheckConditionImpl::alwaysTrueFalse() continue; if (Token::simpleMatch(condition, "return") && Token::Match(tok, "%assign%")) continue; - if (Token::simpleMatch(tok->astParent(), "return") && Token::Match(tok, ".|%var%")) + if (Token::simpleMatch(tok->astParent(), "return") && Token::Match(tok, ".|%var%") && + !(tok->hasKnownValue(ValueFlow::Value::ValueType::SYMBOLIC) && tok->getKnownValue(ValueFlow::Value::ValueType::SYMBOLIC)->tokvalue->str() == "(")) continue; bool warnForNumber = false; if (Token::Match(tok, "%num%|%bool%|%char%")) { diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 5e35ef08f6b..2c8ed104f78 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -4878,7 +4878,7 @@ class TestCondition : public TestFixture { " }\n" " return false;\n" "}\n"); - TODO_ASSERT_EQUALS("[test.cpp:6:12] -> [test.cpp:7:21]: (style) Assigned value 's.g()' is always true [knownConditionTrueFalse]\n", "", errout_str()); + ASSERT_EQUALS("[test.cpp:6:12] -> [test.cpp:8:16]: (style) Return value 'b' is always true [knownConditionTrueFalse]\n", errout_str()); check("static bool parse(int r) {\n" // #15031 " bool res = false;\n" From 5bcc37baae87a0e54ef5c57aaaa8fb4f33cbfdff Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 15 Sep 2026 21:47:15 +0200 Subject: [PATCH 2/2] Fix --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 7a0148a24a2..e9e717ef544 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2368,7 +2368,7 @@ bool SymbolDatabase::isRecordTypeWithoutSideEffects(const Type* type) const for (const Variable& var : type->classScope->varlist) { withoutSideEffects = isVariableWithoutSideEffects(var, type); if (!withoutSideEffects) { - return withoutSideEffects; + return false; } } return (withoutSideEffects = true);