File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -8619,6 +8619,10 @@ void Tokenizer::findGarbageCode() const
86198619 syntaxError (tok->tokAt (2 ), " Unexpected token '" + tok->strAt (2 ) + " '" );
86208620 if (const Token* start = SymbolDatabase::isEnumDefinition (tok)) {
86218621 for (const Token* tok2 = start->next (); tok2 && tok2 != start->link (); tok2 = tok2->next ()) {
8622+ if (Token::simpleMatch (tok2, " sizeof (" )) {
8623+ tok2 = tok2->linkAt (1 );
8624+ continue ;
8625+ }
86228626 if (tok2->str () == " ;" )
86238627 syntaxError (tok2);
86248628 }
Original file line number Diff line number Diff line change @@ -7216,6 +7216,8 @@ class TestTokenizer : public TestFixture {
72167216 ASSERT_NO_THROW (tokenizeAndStringify (" class A { bool restrict() const; };\n "
72177217 " bool A::restrict() const { return true; }" )); // #12718
72187218
7219+ ASSERT_NO_THROW (tokenizeAndStringify (" enum { E = sizeof(struct { int i; }) };" )); // #13249
7220+
72197221 ignore_errout ();
72207222 }
72217223
You can’t perform that action at this time.
0 commit comments