Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2221615/?format=api
{ "id": 2221615, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221615/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260410002735.1424952-1-polacek@redhat.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260410002735.1424952-1-polacek@redhat.com>", "date": "2026-04-10T00:27:35", "name": "c++/reflection: fn call with splice in decltype rejected [PR124835]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "9dde63f88309a8b7ea7004f4c63422ba2232f236", "submitter": { "id": 14370, "url": "http://patchwork.ozlabs.org/api/1.1/people/14370/?format=api", "name": "Marek Polacek", "email": "polacek@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260410002735.1424952-1-polacek@redhat.com/mbox/", "series": [ { "id": 499372, "url": "http://patchwork.ozlabs.org/api/1.1/series/499372/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499372", "date": "2026-04-10T00:27:35", "name": "c++/reflection: fn call with splice in decltype rejected [PR124835]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499372/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221615/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221615/checks/", "tags": {}, "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=OR8wA7lq;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=OR8wA7lq", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsHhp0Jbgz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 10:28:26 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0206E4BA2E10\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 00:28:24 +0000 (GMT)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 2A6DD4BA2E33\n for <gcc-patches@gcc.gnu.org>; Fri, 10 Apr 2026 00:27:46 +0000 (GMT)", "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-65-v16PGviRNrm9_KMKoc0uIw-1; Thu,\n 09 Apr 2026 20:27:42 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 5DAC01801356\n for <gcc-patches@gcc.gnu.org>; Fri, 10 Apr 2026 00:27:41 +0000 (UTC)", "from pdp-11.redhat.com (unknown [10.22.65.94])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id C43AC1800451; Fri, 10 Apr 2026 00:27:40 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 0206E4BA2E10", "OpenDKIM Filter v2.11.0 sourceware.org 2A6DD4BA2E33" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 2A6DD4BA2E33", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 2A6DD4BA2E33", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775780866; cv=none;\n b=KmanrFT6+frYRuyahvPFopbkNCjKEKugVmD3ZUjPDdLZIE1nyiUbIleVby8az/K8NOKqZSjfZSFjmCiMhOi2nHh/8lcfQSm0OvSv1iuuTk4JGwdykdJ/yg21cWLw8szOOWteKSHtG/G0hIH2eSXggChNI+ZwAnXRSQ4dYMEOvXc=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775780866; c=relaxed/simple;\n bh=oUF1ujMxZwdE0lafXUuWww65AvHcQ+fZbh5p3ir5EgI=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=jDMj2CbVxRcihD0ey45CL1QhSeGOjE7aBSxwwCJDGqr0+sbx/v7yt2uUPe2zE1jPVJ8AUlb/6hb/qtFsaDcDOAimjv0l/2LpJQLNufjg1squaUVPBl5Y7sT8wPgLe2HGhIKXSHN3IpsmjJBEhmxmHrgQrt7wJceWR45z/YsccWw=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775780865;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=W4Ln+THW6aTWToF9QslA0M1uajkJvBgJlmS+COluNfg=;\n b=OR8wA7lqFRZJQgZglW8OI50iiGRDbYSDLZI6Wj9fM689zO2X6rj/jU/kYlD8n91TiLtWH+\n SadLTaIHL7U8etOJL0G8pzrsqWW95nV7TrUuOhsHGyH9TLautVfWlmVgIF4cDkoNwbbvAy\n JBsugESrGionaXahd4J0t1VphyELyKY=", "X-MC-Unique": "v16PGviRNrm9_KMKoc0uIw-1", "X-Mimecast-MFC-AGG-ID": "v16PGviRNrm9_KMKoc0uIw_1775780861", "From": "Marek Polacek <polacek@redhat.com>", "To": "GCC Patches <gcc-patches@gcc.gnu.org>,\n\tJason Merrill <jason@redhat.com>", "Subject": "[PATCH] c++/reflection: fn call with splice in decltype rejected\n [PR124835]", "Date": "Thu, 9 Apr 2026 20:27:35 -0400", "Message-ID": "<20260410002735.1424952-1-polacek@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "mqxIb-oBqryMKvdguLwFkZO4wWD6sxeiI8TYn2tOsLM_1775780861", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "I found this while working on the mangling patch and this bug\nblocks that patch.\n\nBootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?\n\n-- >8 --\nHere we reject the valid\n\n decltype([:^^foo<int>:](42))\n\nsaying that a ')' is expected. [dcl.type.decltype] says \"if E is an\nunparenthesized splice-expression, decltype(E) is...\" and we handle it\nby calling _splice_expression and setting id_expression_or_member_access_p.\n\nBut for the code above we shouldn't do this, because the [: :] isn't\nthe sole operand of decltype. _nth_token_starts_splice_without_nns_p\nchecks that there's no :: after the :] but here we want to check that\nthe [: :] is followed by a ')'.\n\n\tPR c++/124835\n\ngcc/cp/ChangeLog:\n\n\t* parser.cc (cp_parser_decltype_expr): Check that [: :] is\n\tfollowed by a ')' before declaring it an unparenthesized\n\tsplice-expression.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/reflect/decltype2.C: New test.\n---\n gcc/cp/parser.cc | 11 ++++++++++-\n gcc/testsuite/g++.dg/reflect/decltype2.C | 12 ++++++++++++\n 2 files changed, 22 insertions(+), 1 deletion(-)\n create mode 100644 gcc/testsuite/g++.dg/reflect/decltype2.C\n\n\nbase-commit: 9772e8d3c2dd45195ec6d0d0c00f533d976ac249", "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex fe27a15a283..6493a26a149 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -19387,7 +19387,16 @@ cp_parser_decltype_expr (cp_parser *parser,\n /* [dcl.type.decltype] \"if E is an unparenthesized splice-expression,\n \t decltype(E) is the type of the entity, object, or value designated\n \t by the splice-specifier of E\" */\n- if (cp_parser_nth_token_starts_splice_without_nns_p (parser, 1))\n+ const bool unparenthesized_splice_expr_p = [&] {\n+\t/* The next token must be '[:'. */\n+\tif (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_SPLICE))\n+\t return false;\n+\t/* Skip to the end of the ':]' and see if the closing ')' follows. */\n+\tsaved_token_sentinel toks (parser->lexer, STS_ROLLBACK);\n+\treturn (cp_parser_skip_entire_splice_expr (parser)\n+\t\t&& cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN));\n+ } ();\n+ if (unparenthesized_splice_expr_p)\n \t{\n \t cp_id_kind idk;\n \t expr = cp_parser_splice_expression (parser, /*template_p=*/false,\ndiff --git a/gcc/testsuite/g++.dg/reflect/decltype2.C b/gcc/testsuite/g++.dg/reflect/decltype2.C\nnew file mode 100644\nindex 00000000000..cc5532c7957\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/decltype2.C\n@@ -0,0 +1,12 @@\n+// PR c++/124835\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+template<typename T>\n+constexpr T foo (T t) { return t; }\n+\n+int bar (int);\n+\n+static_assert ([:^^foo<int>:](42) == 42);\n+decltype([:^^foo<int>:](42)) a = 42;\n+decltype([:^^foo<int>:]) &b = bar;\n", "prefixes": [] }