From f6efd8c6be1a71743fc68355e25326cc9882e554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 18 Jul 2021 20:00:20 +0200 Subject: [PATCH] CI; Fix self check false positive --- lib/checkfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkfunctions.cpp b/lib/checkfunctions.cpp index de913e663..d4d87141e 100644 --- a/lib/checkfunctions.cpp +++ b/lib/checkfunctions.cpp @@ -273,11 +273,11 @@ void CheckFunctions::checkMissingReturn() } if (inconclusive && Token::simpleMatch(scope->bodyEnd->tokAt(-2), ") ; }")) { const Token *ftok = scope->bodyEnd->linkAt(-2)->previous(); - if (mSettings->library.isNotLibraryFunction(ftok) && !ftok->isKeyword()) { + if (mSettings->library.isNotLibraryFunction(ftok)) { const Token *tok = ftok; while (Token::Match(tok->tokAt(-2), "%name% :: %name%")) tok = tok->tokAt(-2); - if (Token::Match(tok->previous(), "[;{}] %name% (|::")) + if (Token::Match(tok->previous(), "[;{}] %name% (|::") && !tok->isKeyword()) missingReturnError(tok, Certainty::inconclusive); } }