From 6c4cf3b463495f0d9f45d749d2d3d7a2c9dd0b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 8 Mar 2026 11:35:00 +0100 Subject: [PATCH 1/2] Add test --- test/testtokenize.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index e59f7b3be62..eefc0b8aba0 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7147,6 +7147,7 @@ class TestTokenizer : public TestFixture { ASSERT_EQUALS("crequires{ac::||= a{b{||", testAst("template concept c = requires { a{} || b{}; } || a::c;")); ASSERT_EQUALS("ifrequires{(", testAst("if (requires { true; }) {}")); // #13308 + ASSERT_EQUALS("Crequires({requires({||= sizeofT(4== sizeofT(8==", testAst("concept C = requires() { sizeof(T) == 4; } || requires() { sizeof(T) == 8; };")); } void astcast() { From b192a28114f61b97a4ab79957871c0c6742a04a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Sun, 8 Mar 2026 11:22:37 +0100 Subject: [PATCH 2/2] Fix #14567 --- lib/tokenlist.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 0ffcf7e37e4..a46fad5d021 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -1055,7 +1055,10 @@ static void compilePrecedence2(Token *&tok, AST_state& state) else compileUnaryOp(tok, state, compileExpression); tok = tok2->link()->next(); - } else if (Token::simpleMatch(tok->previous(), "requires {")) { + } else if (Token::simpleMatch(tok->previous(), "requires {") + || (Token::simpleMatch(tok->previous(), ")") + && tok->linkAt(-1) + && Token::simpleMatch(tok->linkAt(-1)->previous(), "requires ("))) { tok->astOperand1(state.op.top()); state.op.pop(); state.op.push(tok);