Skip to content

Commit

Permalink
Revert "Fix FP knownConditionTrueFalse in local type definition"
Browse files Browse the repository at this point in the history
This reverts commit 66cc8cd.
  • Loading branch information
chrchr-github committed Aug 19, 2023
1 parent f8439e9 commit 26e4493
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions lib/checkcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
9 changes: 0 additions & 9 deletions test/testcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 26e4493

Please sign in to comment.