Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jun 25, 2024
1 parent 9c950e9 commit 1375119
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8698,7 +8698,9 @@ void Tokenizer::findGarbageCode() const
}
if (Token::Match(tok, "%num%|%bool%|%char%|%str% %num%|%bool%|%char%|%str%") && !Token::Match(tok, "%str% %str%"))
syntaxError(tok);
if (Token::Match(tok, "%num%|%bool%|%char%|%str% {"))
if (Token::Match(tok, "%num%|%bool%|%char%|%str% {") &&
!(tok->tokType() == Token::Type::eString && Token::simpleMatch(tok->tokAt(-1), "extern")) &&
!(tok->tokType() == Token::Type::eBoolean && cpp && Token::simpleMatch(tok->tokAt(-1), "requires")))
syntaxError(tok);
if (Token::Match(tok, "%assign% typename|class %assign%"))
syntaxError(tok);
Expand Down

0 comments on commit 1375119

Please sign in to comment.