From 82dce4d4196b328e1ff3cf0f8cb068eda112a554 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 08:19:14 +0100 Subject: [PATCH 1/6] Update other_test.py --- test/cli/other_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cli/other_test.py b/test/cli/other_test.py index 2ff65efc052..22757dc53d7 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -788,7 +788,7 @@ def test_addon_misc(tmpdir): f.write(""" extern void f() { - char char* [] = {"a" "b"} + const char* c[] = {"a" "b"}; } """) From c4e4f59ed0751d534dc1782f8b52d47efbdd068c Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 08:29:01 +0100 Subject: [PATCH 2/6] Update other_test.py --- test/cli/other_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cli/other_test.py b/test/cli/other_test.py index 22757dc53d7..8f543924ae7 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -800,7 +800,7 @@ def test_addon_misc(tmpdir): assert lines == [ 'Checking {} ...'.format(test_file) ] - assert stderr == '{}:4:26: style: String concatenation in array initialization, missing comma? [misc-stringConcatInArrayInit]\n'.format(test_file) + assert stderr == '{}:4:28: style: String concatenation in array initialization, missing comma? [misc-stringConcatInArrayInit]\n'.format(test_file) def test_invalid_addon_json(tmpdir): From 492b85e58b4e97c59dcba10c71e78c136efde17f Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:08:38 +0100 Subject: [PATCH 3/6] Update tokenize.cpp --- lib/tokenize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index b485b3fb2cc..c2ecb907028 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8765,6 +8765,8 @@ void Tokenizer::findGarbageCode() const syntaxError(tok, prev == tok->previous() ? (prev->str() + " " + tok->str()) : (prev->str() + " .. " + tok->str())); } } + else if (tok->isStandardType() && tok->next() && tok->str() == tok->strAt(1) && tok->str() != "long") + syntaxError(tok); } // invalid struct declaration From 83f6f9e357bbd28b1d6717982c83307767bd0859 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:19:48 +0100 Subject: [PATCH 4/6] Update testgarbage.cpp --- test/testgarbage.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index d7e6ed8345b..7bc1fc6b4da 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -258,7 +258,8 @@ class TestGarbage : public TestFixture { TEST_CASE(garbageCode227); TEST_CASE(garbageCode228); TEST_CASE(garbageCode229); - TEST_CASE(garbageCode230); + TEST_CASE(garbageCode230); + TEST_CASE(garbageCode231); TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1 @@ -1775,6 +1776,9 @@ class TestGarbage : public TestFixture { void garbageCode230() { // #14432 ASSERT_THROW_INTERNAL(checkCode("e U U,i"), SYNTAX); } + void garbageCode231() { + ASSERT_THROW_INTERNAL(checkCode("char char* [] = {"a" "b"}"), SYNTAX); + } void syntaxErrorFirstToken() { From d87b562c4fe852647aea3a5196174546af59e413 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:24:18 +0100 Subject: [PATCH 5/6] Update testgarbage.cpp --- test/testgarbage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 7bc1fc6b4da..f09afd58945 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -1777,7 +1777,7 @@ class TestGarbage : public TestFixture { ASSERT_THROW_INTERNAL(checkCode("e U U,i"), SYNTAX); } void garbageCode231() { - ASSERT_THROW_INTERNAL(checkCode("char char* [] = {"a" "b"}"), SYNTAX); + ASSERT_THROW_INTERNAL(checkCode("char char* [] = {\"a\" \"b\"}"), SYNTAX); } From b9801eb41b580da035c6c84bfce5f65336eb19ed Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:24:45 +0100 Subject: [PATCH 6/6] Update testgarbage.cpp --- test/testgarbage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index f09afd58945..5f6b67867f7 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -258,7 +258,7 @@ class TestGarbage : public TestFixture { TEST_CASE(garbageCode227); TEST_CASE(garbageCode228); TEST_CASE(garbageCode229); - TEST_CASE(garbageCode230); + TEST_CASE(garbageCode230); TEST_CASE(garbageCode231); TEST_CASE(garbageCodeFuzzerClientMode1); // test cases created with the fuzzer client, mode 1