From 6f450ff65613cc8591d1201f96a2fb89025167ce Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:46:14 +0200 Subject: [PATCH 1/2] Update tokenize.cpp --- lib/tokenize.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 2279f16a80e..8eb139f0b36 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9109,7 +9109,8 @@ void Tokenizer::findGarbageCode() const if (tok->strAt(1) == "(") syntaxError(tok); else if (!(tok->tokType() == Token::Type::eString && Token::simpleMatch(tok->tokAt(-1), "extern")) && - !(tok->tokType() == Token::Type::eBoolean && cpp && Token::simpleMatch(tok->tokAt(-1), "requires"))) + !(tok->tokType() == Token::Type::eBoolean && cpp && Token::simpleMatch(tok->tokAt(-1), "requires")) && + !Token::simpleMatch(tok->linkAt(1), "} ;")) syntaxError(tok); } if (Token::Match(tok, "( ) %num%|%bool%|%char%|%str%")) From 572335e91bdd908e77fb64581bd2563ae2cf930b Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:51:16 +0200 Subject: [PATCH 2/2] Update testtokenize.cpp --- test/testtokenize.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ddccaa62584..ecfc169bba8 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -8128,6 +8128,7 @@ class TestTokenizer : public TestFixture { ignore_errout(); ASSERT_EQUALS(";", tokenizeAndStringify("typedef std::size_t size_t;\n")); // #14809 + ASSERT_EQUALS("struct S { int i { 0 } ; } ;", tokenizeAndStringify("struct S { int i : 1{0}; };\n")); // #15070 }