Fixed false positive #4648

This commit is contained in:
PKEuS 2014-08-31 20:33:27 +02:00
parent 3ccdae78ba
commit 8722bba52a
2 changed files with 9 additions and 2 deletions

View File

@ -175,9 +175,9 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer, const char Fi
funcname = tok->next(); funcname = tok->next();
} }
else if (Token::Match(tok, "[;{}.,()[=+-/|!?:] &| %var% [(),;:}]")) { else if (Token::Match(tok, "[;{}.,()[=+-/|!?:] &| %var% [(),;]:}]")) {
funcname = tok->next(); funcname = tok->next();
if (tok->str() == "&") if (funcname->str() == "&")
funcname = funcname->next(); funcname = funcname->next();
} }

View File

@ -51,6 +51,7 @@ private:
TEST_CASE(attribute); // #3471 - FP __attribute__(constructor) TEST_CASE(attribute); // #3471 - FP __attribute__(constructor)
TEST_CASE(initializer_list); TEST_CASE(initializer_list);
TEST_CASE(member_function_ternary); TEST_CASE(member_function_ternary);
TEST_CASE(boost);
TEST_CASE(multipleFiles); // same function name in multiple files TEST_CASE(multipleFiles); // same function name in multiple files
@ -310,6 +311,12 @@ private:
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }
void boost() {
check("static void _xy(const char *b, const char *e)\n"
"{}\n"
"parse(line, blanks_p >> ident[&_xy] >> blanks_p >> eol_p).full");
ASSERT_EQUALS("", errout.str());
}
void multipleFiles() { void multipleFiles() {
CheckUnusedFunctions c; CheckUnusedFunctions c;