File tree 2 files changed +6
-0
lines changed
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
8619
8619
syntaxError(tok->tokAt(2), "Unexpected token '" + tok->strAt(2) + "'");
8620
8620
if (const Token* start = SymbolDatabase::isEnumDefinition(tok)) {
8621
8621
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
+ }
8622
8626
if (tok2->str() == ";")
8623
8627
syntaxError(tok2);
8624
8628
}
Original file line number Diff line number Diff line change @@ -7216,6 +7216,8 @@ class TestTokenizer : public TestFixture {
7216
7216
ASSERT_NO_THROW (tokenizeAndStringify (" class A { bool restrict() const; };\n "
7217
7217
" bool A::restrict() const { return true; }" )); // #12718
7218
7218
7219
+ ASSERT_NO_THROW (tokenizeAndStringify (" enum { E = sizeof(struct { int i; }) };" )); // #13249
7220
+
7219
7221
ignore_errout ();
7220
7222
}
7221
7223
You can’t perform that action at this time.
0 commit comments