File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9169,11 +9169,14 @@ void Tokenizer::findGarbageCode() const
91699169 if (Token::simpleMatch (tok, " ::" )) {
91709170 if (!Token::Match (tok->next (), " %name%|*|~" ) || (tok->next ()->isKeyword () && !Token::Match (tok->next (), " new|delete|operator" )))
91719171 syntaxError (tok);
9172- if (Token::simpleMatch (tok->tokAt (-1 ), " )" ) && !Token::simpleMatch (tok->linkAt (-1 )->tokAt (-1 ), " decltype (" )) {
9173- if (tok->linkAt (-1 )->tokAt (-1 ) && tok->linkAt (-1 )->tokAt (-1 )->isUpperCaseName ())
9174- unknownMacroError (tok);
9175- else
9176- syntaxError (tok);
9172+ if (Token::simpleMatch (tok->tokAt (-1 ), " )" )) {
9173+ const Token* const prev = tok->linkAt (-1 )->tokAt (-1 );
9174+ if (!Token::Match (prev, " %name% (" ) || (!prev->isControlFlowKeyword () && prev->str () != " decltype" )) {
9175+ if (prev && prev->isUpperCaseName ())
9176+ unknownMacroError (prev);
9177+ else
9178+ syntaxError (tok);
9179+ }
91779180 }
91789181 }
91799182 if (Token::Match (tok, " & %comp%|&&|%oror%|&|%or%" ) && tok->strAt (1 ) != " >" )
Original file line number Diff line number Diff line change @@ -3773,7 +3773,8 @@ class TestSymbolDatabase : public TestFixture {
37733773 }
37743774
37753775 void symboldatabase35() { // ticket #4806 and #4841
3776- ASSERT_THROW_INTERNAL(check("class FragmentQueue : public CL_NS(util)::PriorityQueue<CL_NS(util)::Deletor::Object<TextFragment> >\n"), UNKNOWN_MACRO);
3776+ ASSERT_THROW_INTERNAL(check("class FragmentQueue : public CL_NS(util)::PriorityQueue<CL_NS(util)::Deletor::Object<TextFragment> >\n"
3777+ "{};\n"), UNKNOWN_MACRO);
37773778 }
37783779
37793780 void symboldatabase36() { // ticket #4892
You can’t perform that action at this time.
0 commit comments