Skip to content

Commit 8ab1ca9

Browse files
Update checkclass.cpp
1 parent 1349826 commit 8ab1ca9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/checkclass.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ void CheckClassImpl::privateFunctions()
14281428
void CheckClassImpl::unusedPrivateFunctionError(const Token* tok1, const Token *tok2, const std::string &classname, const std::string &funcname)
14291429
{
14301430
std::list<const Token *> toks{ tok1 };
1431-
if (tok2)
1431+
if (tok2 && tok2 != tok1)
14321432
toks.push_front(tok2);
14331433
reportError(toks, Severity::style, "unusedPrivateFunction", "$symbol:" + classname + "::" + funcname + "\nUnused private function: '$symbol'", CWE398, Certainty::normal);
14341434
}

0 commit comments

Comments
 (0)