CheckClass: previous change introduced false positives when Token::function() is wrong. Avoid those false positives.
This commit is contained in:
parent
bce15b1ade
commit
65998f1d7c
|
@ -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()) {
|
for (const Token *ftok = func->functionScope->classDef->linkAt(1); ftok != func->functionScope->classEnd; ftok = ftok->next()) {
|
||||||
if (ftok->function() == privfunc)
|
if (ftok->function() == privfunc)
|
||||||
return true;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
} else if ((func->type != Function::eCopyConstructor &&
|
} else if ((func->type != Function::eCopyConstructor &&
|
||||||
|
|
|
@ -408,7 +408,7 @@ private:
|
||||||
" void f() { }\n"
|
" void f() { }\n"
|
||||||
" void f(int) { }\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() {
|
void incompleteImplementation() {
|
||||||
|
|
Loading…
Reference in New Issue