File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9116,7 +9116,8 @@ void Tokenizer::findGarbageCode() const
91169116 if (tok->strAt (1 ) == " (" )
91179117 syntaxError (tok);
91189118 else if (!(tok->tokType () == Token::Type::eString && Token::simpleMatch (tok->tokAt (-1 ), " extern" )) &&
9119- !(tok->tokType () == Token::Type::eBoolean && cpp && Token::simpleMatch (tok->tokAt (-1 ), " requires" )))
9119+ !(tok->tokType () == Token::Type::eBoolean && cpp && Token::simpleMatch (tok->tokAt (-1 ), " requires" )) &&
9120+ !Token::simpleMatch (tok->linkAt (1 ), " } ;" ))
91209121 syntaxError (tok);
91219122 }
91229123 if (Token::Match (tok, " ( ) %num%|%bool%|%char%|%str%" ))
Original file line number Diff line number Diff line change @@ -8138,6 +8138,7 @@ class TestTokenizer : public TestFixture {
81388138 ignore_errout ();
81398139
81408140 ASSERT_EQUALS (" ;" , tokenizeAndStringify (" typedef std::size_t size_t;\n " )); // #14809
8141+ ASSERT_EQUALS (" struct S { int i { 0 } ; } ;" , tokenizeAndStringify (" struct S { int i : 1{0}; };\n " )); // #15070
81418142 }
81428143
81438144
You can’t perform that action at this time.
0 commit comments