From 26e4493d4442f6a479934dbb6286eed6bebfbe70 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Sun, 20 Aug 2023 00:12:50 +0200 Subject: [PATCH] Revert "Fix FP knownConditionTrueFalse in local type definition" This reverts commit 66cc8cd4d0f3f07ea81525eff2033c79fe65f44c. --- lib/checkcondition.cpp | 2 -- test/testcondition.cpp | 9 --------- 2 files changed, 11 deletions(-) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index faf4a0008b5..8219d04b1ec 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -1464,8 +1464,6 @@ void CheckCondition::alwaysTrueFalse() const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase(); for (const Scope * scope : symbolDatabase->functionScopes) { for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) { - if (tok->scope()->isClassOrStructOrUnion()) - continue; if (Token::simpleMatch(tok, "<") && tok->link()) // don't write false positives when templates are used continue; if (!tok->hasKnownBoolValue()) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 17a1e18efd7..b60be8b831b 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -4529,15 +4529,6 @@ class TestCondition : public TestFixture { "[test.cpp:7]: (style) Condition 'p' is always true\n" "[test.cpp:8]: (style) Condition '&i' is always true\n", errout.str()); - - check("void f() {\n" - " struct S {\n" - " int n;\n" - " bool r;\n" - " S(int i, bool b = true) : n(i), r(b) {}\n" - " };\n" - "}\n"); - ASSERT_EQUALS("", errout.str()); } void alwaysTrueSymbolic()