get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223760,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223760/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/aeCNJqmXEP1b7PEw@tucnak/",
    "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": "<aeCNJqmXEP1b7PEw@tucnak>",
    "date": "2026-04-16T07:17:58",
    "name": "c++: Fix up expansion-stmt mangling ICE [PR124120]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f2ee78701aea1942cd3e68e39875eaaf8725670b",
    "submitter": {
        "id": 671,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/671/?format=api",
        "name": "Jakub Jelinek",
        "email": "jakub@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/aeCNJqmXEP1b7PEw@tucnak/mbox/",
    "series": [
        {
            "id": 500087,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500087/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500087",
            "date": "2026-04-16T07:17:58",
            "name": "c++: Fix up expansion-stmt mangling ICE [PR124120]",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500087/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223760/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223760/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=M+NGDLPG;\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=M+NGDLPG",
            "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 4fx8WK3yX9z1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 17:18:37 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 85BFA4BA2E0A\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 07:18:35 +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 7722F4BA2E3B\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 07:18:07 +0000 (GMT)",
            "from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-07qvQevoNai3xh_9xJSCzg-1; Thu,\n 16 Apr 2026 03:18:03 -0400",
            "from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id C99B8195608B\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 07:18:02 +0000 (UTC)",
            "from tucnak.zalov.cz (unknown [10.44.33.129])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 2D8F0195608E; Thu, 16 Apr 2026 07:18:01 +0000 (UTC)",
            "from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63G7Hxgr887448\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Thu, 16 Apr 2026 09:17:59 +0200",
            "(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63G7HwwE887447;\n Thu, 16 Apr 2026 09:17:58 +0200"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 85BFA4BA2E0A",
            "OpenDKIM Filter v2.11.0 sourceware.org 7722F4BA2E3B"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 7722F4BA2E3B",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 7722F4BA2E3B",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776323887; cv=none;\n b=ZITMi7Q4hfbXaA2lS2sB6KVYdKYOQD4VIMnCmhgEzNgk+UhOUbsGzezs/8SDnRQPRChFRrrt3Jl/PKU9OwHwyg1+1CuI/OvsGiEYB3PPSlZeK1VXVQFRrICB+j/7lTdpe4v6NO7JF9rEsAqKl79zoh2keQmE4WAFVm/uM0N3ZPs=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776323887; c=relaxed/simple;\n bh=KY4ravclQ096T9VtCj/BM4ksrpYJG9sR0Mw+ZKSvbFo=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=w7bLFMMXLfk3U0P88yQObx0T8V4T1Oyp9D/9FV3cvdxEDP7iaG5q/GBTTh/a1z+CbyLzaweyHSy0s0YM7/n8qZRyYg2y6fu5+nxUr6P5NseYT7LDlb6vGL9+l2YUAxpF1eBzgNnjAgIGoSa6ANzfdLGavrApouMrpgaGRwl8DXc=",
        "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=1776323886;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type; bh=zCgtgnSxFke7G6PfXxKC27/egyYf2NL4u+atn1QG3yY=;\n b=M+NGDLPGhYOoQRfs4xcMpGwFBgSqlwPokl9S85CaYuYwdWljNaUt0N12RrTSnG7bVdC2RF\n Tx+D2HHF5ke3Oh16DiO9SITFJRGFh2wjPbNr3nO9+GnBaifD1UotVvIQ+BSGMC6/H8jgu/\n W2TJvOCIEJMHJLq//qn82ryIkcQIEOM=",
        "X-MC-Unique": "07qvQevoNai3xh_9xJSCzg-1",
        "X-Mimecast-MFC-AGG-ID": "07qvQevoNai3xh_9xJSCzg_1776323883",
        "Date": "Thu, 16 Apr 2026 09:17:58 +0200",
        "From": "Jakub Jelinek <jakub@redhat.com>",
        "To": "Jason Merrill <jason@redhat.com>",
        "Cc": "gcc-patches@gcc.gnu.org",
        "Subject": "[PATCH] c++: Fix up expansion-stmt mangling ICE [PR124120]",
        "Message-ID": "<aeCNJqmXEP1b7PEw@tucnak>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.17",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "35FMyd4U9vigaHk1AZFBLi6U8ocDCfjC7XVA_D_tsa4_1776323883",
        "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>",
        "Reply-To": "Jakub Jelinek <jakub@redhat.com>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "Hi!\n\nOne of the reflect/* tests ICEs on Solaris but not on Linux (at least not\nwhen using recent glibc).\nI've tracked it down to a problem with expansion statements, due to the\nworkaround we have for missing part of P2686R4 where we make some artificial\nvars static.  Some of them (the __for_range and __for_begin) have DECL_NAMEs\n(with a space in it) and so even when they are static, don't cause problems.\nBut the iter variable (in https://eel.is/c++draft/stmt.expand#5.2 ) is when\nconstexpr still static and was nameless.\nNow, because it is constexpr and not odr used, it is optimized out, but if\nthe TU also contains weakref attribute or something else that requires\ncgraph to construct assembler_name_hash, we ICE when trying to mangle\nthe iter nameless variable.\n\nThe following patch fixes that by giving it yet another artificial name.\n\nBootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?\n\n2026-04-16  Jakub Jelinek  <jakub@redhat.com>\n\n\tPR c++/124120\n\t* pt.cc (finish_expansion_stmt): Give iter variable an artificial\n\tname.\n\n\t* g++.dg/cpp26/expansion-stmt40.C: New test.\n\n\n\tJakub",
    "diff": "--- gcc/cp/pt.cc.jj\t2026-04-15 09:01:57.886372126 +0200\n+++ gcc/cp/pt.cc\t2026-04-15 14:59:25.084554609 +0200\n@@ -33664,7 +33664,8 @@ finish_expansion_stmt (tree expansion_st\n \t  if (DECL_DECLARED_CONSTEXPR_P (range_decl)\n \t      && !TYPE_REF_P (iter_type))\n \t    iter_type = cp_build_qualified_type (iter_type, TYPE_QUAL_CONST);\n-\t  iter = build_decl (loc, VAR_DECL, NULL_TREE, iter_type);\n+\t  iter = build_decl (loc, VAR_DECL, get_identifier (\"__for_iter \"),\n+\t\t\t     iter_type);\n \t  TREE_USED (iter) = 1;\n \t  DECL_ARTIFICIAL (iter) = 1;\n \t  if (DECL_DECLARED_CONSTEXPR_P (range_decl))\n--- gcc/testsuite/g++.dg/cpp26/expansion-stmt40.C.jj\t2026-04-15 15:22:48.992056372 +0200\n+++ gcc/testsuite/g++.dg/cpp26/expansion-stmt40.C\t2026-04-15 15:43:02.282796097 +0200\n@@ -0,0 +1,40 @@\n+// PR c++/124120\n+// { dg-do compile { target c++14 } }\n+// { dg-require-weak \"\" }\n+// { dg-options \"\" }\n+\n+struct A\n+{\n+  int x;\n+  constexpr explicit A (int v) : x(v) {}\n+  constexpr A &operator ++ () { ++x; return *this; }\n+  constexpr int operator * () const { return x; }\n+  constexpr bool operator != (const A &o) const { return x != o.x; }\n+  constexpr A operator + (int o) const { A r (x + o); return r; }\n+  constexpr int operator - (const A &o) const { return x - o.x; }\n+};\n+\n+namespace N\n+{\n+  struct B { constexpr B () {} };\n+  constexpr A begin (const B &) { return A (0); }\n+  constexpr A end (const B &) { return A (6); }\n+}\n+\n+int\n+bar ()\n+{\n+  int r = 0;\n+  template for (constexpr auto i : N::B {})\t\t\t// { dg-warning \"'template for' only available with\" \"\" { target c++23_down } }\n+    r += i;\n+  return r;\n+}\n+\n+extern void plugh ();\n+\n+[[gnu::weakref (\"plugh\")]] static void xyzzy ();\n+\n+void\n+plugh ()\n+{\n+}\n",
    "prefixes": []
}