From 5e6d0a2b17f2d1298a2921457d580686a8e352cf Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 2 Mar 2026 09:01:31 +0100 Subject: [PATCH 1/2] Update tokenlist.cpp --- lib/tokenlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 1138b410ddd..03095a40992 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -873,7 +873,7 @@ static void compileTerm(Token *&tok, AST_state& state) state.inArrayAssignment--; tok = tok1->link()->next(); } - } else if (!state.inArrayAssignment && !Token::simpleMatch(prev, "=")) { + } else if ((!state.inArrayAssignment && !Token::simpleMatch(prev, "=")) || Token::simpleMatch(prev, "?")) { state.op.push(tok); tok = tok->link()->next(); } else { From 046aa9c0777b2932af1168fb37106a487ab059f9 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 2 Mar 2026 09:03:00 +0100 Subject: [PATCH 2/2] Update testtokenize.cpp --- test/testtokenize.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index ee38b2a1dce..7aca456a445 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -426,6 +426,7 @@ class TestTokenizer : public TestFixture { TEST_CASE(astrvaluedecl); TEST_CASE(astorkeyword); TEST_CASE(astenumdecl); + TEST_CASE(astcompound); TEST_CASE(startOfExecutableScope); @@ -7422,6 +7423,11 @@ class TestTokenizer : public TestFixture { ASSERT_EQUALS("A0U=", testAst("enum myclass : unsigned char { A = 0U, };")); } + void astcompound() { + ASSERT_EQUALS("sn0=={(tmp:?=", testAst("Str s = n == 0 ? (Str) { 0 } : tmp;")); // #14548 + ASSERT_EQUALS("s(sstrlens(0:?,{(return", testAst("return (struct Str) { (unsigned char*)s, s ? strlen(s) : 0 };")); + } + #define isStartOfExecutableScope(offset, code) isStartOfExecutableScope_(offset, code, __FILE__, __LINE__) template bool isStartOfExecutableScope_(int offset, const char (&code)[size], const char* file, int line) {