From 93ef9d8eeda48ef936f12b5b1c2e7d4d84ab8769 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:26:06 +0200 Subject: [PATCH 1/3] Update tokenize.cpp --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 40dbdf88f9d..841acb914df 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8995,7 +8995,7 @@ void Tokenizer::findGarbageCode() const syntaxError(tok); if (Token::Match(tok, "[;([{] %comp%|%oror%|%or%|%|/")) syntaxError(tok); - if (Token::Match(tok, "%cop%|= ]") && !Token::simpleMatch(tok, "*") && !(cpp && Token::Match(tok->previous(), "%type%|[|,|%num% &|=|> ]"))) + if (Token::Match(tok, "%cop%|= ]") && !Token::simpleMatch(tok, "*") && !(cpp && Token::Match(tok->previous(), "%type%|[|,|<|%num% &|=|> ]"))) syntaxError(tok); if (Token::Match(tok, "[+-] [;,)]}]") && !(cpp && Token::simpleMatch(tok->previous(), "operator"))) syntaxError(tok); From c4d0b3416aa627db202e669af6073a56326fa571 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:30:13 +0200 Subject: [PATCH 2/3] Update testtokenize.cpp --- test/testtokenize.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index d51f224d7f8..578d12b83d3 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7819,7 +7819,9 @@ class TestTokenizer : public TestFixture { ASSERT_NO_THROW(tokenizeAndStringify("void f() {\n" // #14395 " for (int i : [](int a, int b) { ++a; ++b; return std::vector{a, b}; }(1, 2)) {}\n" - "}\n")); + "}\n")); + + ASSERT_NO_THROW(tokenizeAndStringify("int y = a[x<>];")); // #14676 ignore_errout(); } From ecc9a5b05b75f0ecb8e0304eebc5633100e32dbb Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 20 Apr 2026 12:55:04 +0200 Subject: [PATCH 3/3] Update testtokenize.cpp --- test/testtokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 578d12b83d3..851a63a646a 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7819,7 +7819,7 @@ class TestTokenizer : public TestFixture { ASSERT_NO_THROW(tokenizeAndStringify("void f() {\n" // #14395 " for (int i : [](int a, int b) { ++a; ++b; return std::vector{a, b}; }(1, 2)) {}\n" - "}\n")); + "}\n")); ASSERT_NO_THROW(tokenizeAndStringify("int y = a[x<>];")); // #14676