CheckClass: previous change introduced false positives when Token::function() is wrong. Avoid those false positives.

This commit is contained in:
Daniel Marjamäki 2016-05-16 10:55:22 +02:00
parent bce15b1ade
commit 65998f1d7c
2 changed files with 2 additions and 2 deletions

View File

@ -890,7 +890,7 @@ static bool checkFunctionUsage(const Function *privfunc, const Scope* scope)
for (const Token *ftok = func->functionScope->classDef->linkAt(1); ftok != func->functionScope->classEnd; ftok = ftok->next()) {
if (ftok->function() == privfunc)
return true;
if (ftok->varId() == 0U && !ftok->function() && ftok->str() == privfunc->name()) // TODO: This condition should be redundant
if (ftok->varId() == 0U && ftok->str() == privfunc->name()) // TODO: This condition should be redundant
return true;
}
} else if ((func->type != Function::eCopyConstructor &&

View File

@ -408,7 +408,7 @@ private:
" void f() { }\n"
" void f(int) { }\n"
"};");
ASSERT_EQUALS("[test.cpp:10]: (style) Unused private function: 'A::f'\n", errout.str());
ASSERT_EQUALS("", errout.str());
}
void incompleteImplementation() {