CI; Fix self check false positive

This commit is contained in:
Daniel Marjamäki 2021-07-18 20:00:20 +02:00
parent ae79b4759d
commit f6efd8c6be
1 changed files with 2 additions and 2 deletions

View File

@ -273,11 +273,11 @@ void CheckFunctions::checkMissingReturn()
} }
if (inconclusive && Token::simpleMatch(scope->bodyEnd->tokAt(-2), ") ; }")) { if (inconclusive && Token::simpleMatch(scope->bodyEnd->tokAt(-2), ") ; }")) {
const Token *ftok = scope->bodyEnd->linkAt(-2)->previous(); const Token *ftok = scope->bodyEnd->linkAt(-2)->previous();
if (mSettings->library.isNotLibraryFunction(ftok) && !ftok->isKeyword()) { if (mSettings->library.isNotLibraryFunction(ftok)) {
const Token *tok = ftok; const Token *tok = ftok;
while (Token::Match(tok->tokAt(-2), "%name% :: %name%")) while (Token::Match(tok->tokAt(-2), "%name% :: %name%"))
tok = tok->tokAt(-2); tok = tok->tokAt(-2);
if (Token::Match(tok->previous(), "[;{}] %name% (|::")) if (Token::Match(tok->previous(), "[;{}] %name% (|::") && !tok->isKeyword())
missingReturnError(tok, Certainty::inconclusive); missingReturnError(tok, Certainty::inconclusive);
} }
} }