get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2222804/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2222804,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222804/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/ad00nW_wFL_TxjW6@redhat.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.2/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<ad00nW_wFL_TxjW6@redhat.com>",
    "list_archive_url": null,
    "date": "2026-04-13T18:23:25",
    "name": "[v2] c++/reflection: fn call with splice in decltype rejected [PR124835]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "15362cd3d76d1c2d31abd0a994383c13c85166a8",
    "submitter": {
        "id": 14370,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/14370/?format=api",
        "name": "Marek Polacek",
        "email": "polacek@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/ad00nW_wFL_TxjW6@redhat.com/mbox/",
    "series": [
        {
            "id": 499738,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499738/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=499738",
            "date": "2026-04-13T18:23:25",
            "name": "[v2] c++/reflection: fn call with splice in decltype rejected [PR124835]",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/499738/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222804/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222804/checks/",
    "tags": {},
    "related": [],
    "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=UuCgEMn0;\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=UuCgEMn0",
            "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 4fvbQX512fz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 04:24:03 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 763854BA2E0D\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 18:24:01 +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 0D5834BA2E06\n for <gcc-patches@gcc.gnu.org>; Mon, 13 Apr 2026 18:23:32 +0000 (GMT)",
            "from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-475-SJExVpaRNCad40ngtCUpQA-1; Mon, 13 Apr 2026 14:23:30 -0400",
            "by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8a14905811cso70300586d6.2\n for <gcc-patches@gcc.gnu.org>; Mon, 13 Apr 2026 11:23:30 -0700 (PDT)",
            "from redhat.com ([2603:7000:9500:10::1db4])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8aca4764094sm46492156d6.32.2026.04.13.11.23.26\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 13 Apr 2026 11:23:27 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 763854BA2E0D",
            "OpenDKIM Filter v2.11.0 sourceware.org 0D5834BA2E06"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 0D5834BA2E06",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 0D5834BA2E06",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776104612; cv=none;\n b=WuF+226QPxC5hzfCP6Cgw0fWmZjj1ihtTympXQbmNw6HKEN1xJqkXdWPIXTrLKIosAT7dxtSYoSm+Nk42bDjauG7HyMIv/IGYpDOV1RVENkntW5mABy6tG9con/huovtUcquAcXtVUuie+Og90L8X/zTCtQmGeueFw9fv8uNDlY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776104612; c=relaxed/simple;\n bh=H+Zlu63rRCq/ewIIlFOA6AjUid7r/G/WrEZeIIx43zA=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=Bg8ehMZx1ZtKfp1z3Q17olPCL8U5ByuIZle8R6phzHRXw+Z8qVNH6b2f+IA1CqSezEGUlVcQRinx+pNnp9HuB45YJd9isJjiGyfydXjP0dHsxEXuH8ZN7e+rDoSeGSZF9VkU2cFeZLJQE0Sm7H6JMS7HVVtWosklOhRkXFVrCC0=",
        "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=1776104611;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=Ln3em9/gEHHZpaY5lokfD45QbPzoiFEo7/6vtMewMmw=;\n b=UuCgEMn0yie/GmNYCcCDIdFIpS168tmqs1UJddhRtoY0bPOOSeQ1k6qtxe2M8WoQfkQA0r\n Qgvq5zgRJTzAqQ+cBRTVxcCA4hsA7tD+9wTgxi8SRB9JGemqXv5Sfqb0uqWFwmNMTa4Rtt\n rMtHYyCECfY0AOJzRXS/gwCJoBKFitc=",
        "X-MC-Unique": "SJExVpaRNCad40ngtCUpQA-1",
        "X-Mimecast-MFC-AGG-ID": "SJExVpaRNCad40ngtCUpQA_1776104609",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776104609; x=1776709409;\n h=user-agent:in-reply-to:content-disposition:mime-version:references\n :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=Ln3em9/gEHHZpaY5lokfD45QbPzoiFEo7/6vtMewMmw=;\n b=jMjiJSNa+1xK8ACPDjor9QD5NbXqlFpUDvekqsMqfVCPI56zCXjqxmLISZT+/HzOJo\n NVlm1LluvUNA2BonKOkJ0/MCg9P17YBByvJwShehh6ZjT/17LbOUwpW7Mgbz2r18njsE\n R5c7LB+wtFjANew+X+npbRMnakj+/mXOtZvp/T5YIKGnV9JFRHmivHh/JafGewb8XrQg\n nIdul/gt0VpqVvacsuhCfru7FMfaeNdXjL44MsuF9wT/MqWdQJHk+MKHPuJKfOxDhlRy\n fZzCaZQL4ejQljCpMf4elYokZOGymxyvA5m5wPvB4b3K+jwcOvvIdKdG2H4OMidfclqy\n /nZw==",
        "X-Gm-Message-State": "AOJu0Ywf4juSuK9Mg20q8D1uIKMpbm0K3nhBpZhqSpQOuYGm1G5lXbcx\n cY/09WGTkqKRHSyEyGyR9hLCm/gZAFVMZcZqTUaCB+3ksEIrSxwNgUMqEFn0G0IcZdw3VuEFDz9\n JqqfLSMGtY3q3V26UBbPQRnK9KMrcISiQbMeby0pmhvTovFs9vy9ZvzTZgi1iBZI/Dzk=",
        "X-Gm-Gg": "AeBDieuOsrALz7UGgsP6IaTUNdU6ZwamnwmSppBis31tsVQ42rJWWYZ3FFjtXm/3r/x\n o46Vh/qCBHjSZT2huMZVrwscYHerSQKm3ytDtGHLngu/6ren6bHk4b7NsQKKaYkMNYphpYf851Y\n HUeyn49TlTMPWX+dlAcUCHUJeI98fXzxf+mdAV9I7fKkEGSb60lRTi5iAQ2kwxALUUbjIlYpOkt\n 2qR1tLJ75UiKd948ay2xW1+XjHuH+RAezTDFM6ukhcRzPg0WsyD8pjmtfWu2bcCyA2K2BtZ3H0N\n DCl5u6YoaaHbfCCDtJ+/rSclg+0VuiYhB4/StWFw6lU8mA0hkuQzz0ACafzFLZvpIO/D3BoFelr\n Icg==",
        "X-Received": [
            "by 2002:a05:6214:3901:b0:8a1:fe5c:dc40 with SMTP id\n 6a1803df08f44-8ac86313897mr230320756d6.51.1776104608739;\n Mon, 13 Apr 2026 11:23:28 -0700 (PDT)",
            "by 2002:a05:6214:3901:b0:8a1:fe5c:dc40 with SMTP id\n 6a1803df08f44-8ac86313897mr230319986d6.51.1776104607953;\n Mon, 13 Apr 2026 11:23:27 -0700 (PDT)"
        ],
        "Date": "Mon, 13 Apr 2026 14:23:25 -0400",
        "From": "Marek Polacek <polacek@redhat.com>",
        "To": "Jason Merrill <jason@redhat.com>",
        "Cc": "GCC Patches <gcc-patches@gcc.gnu.org>",
        "Subject": "[PATCH v2] c++/reflection: fn call with splice in decltype rejected\n [PR124835]",
        "Message-ID": "<ad00nW_wFL_TxjW6@redhat.com>",
        "References": "<20260410002735.1424952-1-polacek@redhat.com>\n <ca12a8d8-0303-4ad0-94f6-9c026cb7c8c2@redhat.com>",
        "MIME-Version": "1.0",
        "In-Reply-To": "<ca12a8d8-0303-4ad0-94f6-9c026cb7c8c2@redhat.com>",
        "User-Agent": "Mutt/2.3.1 (2026-03-20)",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "aNnfqXKxW0v2YxX4l_MxO3S4Vsduntc_CCCZDQpqwvA_1776104609",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "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": "On Fri, Apr 10, 2026 at 03:05:18PM -0400, Jason Merrill wrote:\n> On 4/9/26 8:27 PM, Marek Polacek wrote:\n> > I found this while working on the mangling patch and this bug\n> > blocks that patch.\n> > \n> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?\n> > \n> > -- >8 --\n> > Here we reject the valid\n> > \n> >    decltype([:^^foo<int>:](42))\n> > \n> > saying that a ')' is expected.  [dcl.type.decltype] says \"if E is an\n> > unparenthesized splice-expression, decltype(E) is...\" and we handle it\n> > by calling _splice_expression and setting id_expression_or_member_access_p.\n> > \n> > But for the code above we shouldn't do this, because the [: :] isn't\n> > the sole operand of decltype.  _nth_token_starts_splice_without_nns_p\n> > checks that there's no :: after the :] but here we want to check that\n> > the [: :] is followed by a ')'.\n> > \n> > \tPR c++/124835\n> > \n> > gcc/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> > \n> > gcc/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> > diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\n> > index 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> \n> What about a splice-expression with leading 'template'?  I think we can just\n> drop this check and rely on _skip_entire_.\n\nI think we can't have a valid leading 'template' here: in \"template [:X:]\"\nthe X must designate a function template, and\n\n  decltype(template [:^^foo:])\n\nresults in \"cannot resolve address of overloaded function\".  But let's\ndrop the first check anyway.\n \n> Optionally, I wonder about using tentative parsing like for member access\n> just above, rather than token scanning and then parsing.\n> \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,\n> > diff --git a/gcc/testsuite/g++.dg/reflect/decltype2.C b/gcc/testsuite/g++.dg/reflect/decltype2.C\n> > new file mode 100644\n> > index 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> \n> It would be good to check whether decltype gives the right answer.\n\nYes, done.  Also let's check decltype((...)).\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                         | 13 ++++++++++--\n gcc/testsuite/g++.dg/reflect/decltype2.C | 25 ++++++++++++++++++++++++\n 2 files changed, 36 insertions(+), 2 deletions(-)\n create mode 100644 gcc/testsuite/g++.dg/reflect/decltype2.C\n\n\nbase-commit: 9c694b3ecd0eb5308e85a0eac69c4b2d008ca83e",
    "diff": "diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc\nindex fe27a15a283..9dbc2933e7b 100644\n--- a/gcc/cp/parser.cc\n+++ b/gcc/cp/parser.cc\n@@ -19387,10 +19387,19 @@ 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+\tif (!flag_reflection)\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,\n+\t  const bool template_p = cp_parser_optional_template_keyword (parser);\n+\t  expr = cp_parser_splice_expression (parser, template_p,\n \t\t\t\t\t      /*address_p=*/false,\n \t\t\t\t\t      /*template_arg_p=*/false,\n \t\t\t\t\t      /*member_access_p=*/false, &idk);\ndiff --git a/gcc/testsuite/g++.dg/reflect/decltype2.C b/gcc/testsuite/g++.dg/reflect/decltype2.C\nnew file mode 100644\nindex 00000000000..075d490d368\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/reflect/decltype2.C\n@@ -0,0 +1,25 @@\n+// PR c++/124835\n+// { dg-do compile { target c++26 } }\n+// { dg-additional-options \"-freflection\" }\n+\n+template <typename T, typename U>\n+constexpr bool is_same_v = false;\n+\n+template <typename T>\n+constexpr bool is_same_v<T, T> = true;\n+\n+template<typename T>\n+constexpr T foo (T t) { return t; }\n+\n+template<typename T>\n+struct S { };\n+\n+static_assert([:^^foo<int>:](42) == 42);\n+static_assert(is_same_v<decltype([:^^foo<int>:]), int(int)>);\n+static_assert(is_same_v<decltype([:^^foo<int>:](42)), int>);\n+static_assert(is_same_v<decltype(template [:^^foo:](0)), int>);\n+static_assert(is_same_v<decltype(template [:^^foo:]<int>(0)), int>);\n+static_assert(is_same_v<decltype(([:^^foo<int>:])), int(&)(int)>);\n+static_assert(is_same_v<decltype(([:^^foo<int>:](42))), int>);\n+static_assert(is_same_v<decltype((template [:^^foo:](0))), int>);\n+static_assert(is_same_v<decltype((template [:^^foo:]<int>(0))), int>);\n",
    "prefixes": [
        "v2"
    ]
}