get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217381,
    "url": "http://patchwork.ozlabs.org/api/patches/2217381/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/001301dcbe97$baccb7f0$306627d0$@nextmovesoftware.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/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": "<001301dcbe97$baccb7f0$306627d0$@nextmovesoftware.com>",
    "list_archive_url": null,
    "date": "2026-03-28T09:46:18",
    "name": "[C++] PR c++/124753: ICE on invalid P4 regression",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "96b9f7c872076553c68753c0dc852b29fc729ee0",
    "submitter": {
        "id": 68376,
        "url": "http://patchwork.ozlabs.org/api/people/68376/?format=api",
        "name": "Roger Sayle",
        "email": "roger@nextmovesoftware.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/001301dcbe97$baccb7f0$306627d0$@nextmovesoftware.com/mbox/",
    "series": [
        {
            "id": 497860,
            "url": "http://patchwork.ozlabs.org/api/series/497860/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497860",
            "date": "2026-03-28T09:46:18",
            "name": "[C++] PR c++/124753: ICE on invalid P4 regression",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497860/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217381/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217381/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=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com\n header.a=rsa-sha256 header.s=default header.b=IDL8Sstw;\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=fail reason=\"signature verification failed\" (2048-bit key,\n unprotected) header.d=nextmovesoftware.com header.i=@nextmovesoftware.com\n header.a=rsa-sha256 header.s=default header.b=IDL8Sstw",
            "sourceware.org; dmarc=pass (p=none dis=none)\n header.from=nextmovesoftware.com",
            "sourceware.org;\n spf=pass smtp.mailfrom=nextmovesoftware.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=69.48.154.134"
        ],
        "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 4fjXj92r29z1y1j\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 20:46:51 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 6F82D4BA23E8\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 09:46:49 +0000 (GMT)",
            "from server.nextmovesoftware.com (server.nextmovesoftware.com\n [69.48.154.134])\n by sourceware.org (Postfix) with ESMTPS id 544C24BA23D0\n for <gcc-patches@gcc.gnu.org>; Sat, 28 Mar 2026 09:46:20 +0000 (GMT)",
            "from [168.86.198.119] (port=54447 helo=Dell)\n by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls\n TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.99.1)\n (envelope-from <roger@nextmovesoftware.com>)\n id 1w6QFH-00000009Gtr-1ozE for gcc-patches@gcc.gnu.org;\n Sat, 28 Mar 2026 05:46:19 -0400"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 6F82D4BA23E8",
            "OpenDKIM Filter v2.11.0 sourceware.org 544C24BA23D0"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 544C24BA23D0",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 544C24BA23D0",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774691180; cv=none;\n b=hOd5Cjue3EvSWyojDTobWdzc44J8cOOXyISSX/Ctfb0zFuFGOyuhNv+x7wieDaGYg0HwNumJTWyoOEyLe0tWsdbrGPwub2LbSvAGa4q2enCJvr7ZmMjcCZiYyi3tgVn6/BAPVrTO90xpuBGBQab51yfUZ8JrVLN+VRIOEMqY0DU=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774691180; c=relaxed/simple;\n bh=Q225Rr5hSSigulXBsBYAOEPL9SnbFtR4yPOhUkkOfEo=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=s+U5w1cD3vopN2rxHpRU65Yuab9o16mcvB7VJkczcNOw7EA3zRTs+MwfjyVIIEurGMRLlUXzmEKDNYJ076BUCo1twM3JkS0JjKPj77LuZgbdfb05iOGL7fdRh0oV5ofmZBs7cVouNFH/PQ/lj6T07brg3wyORiQRMOgF3Y4uLpI=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID:\n Date:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:\n Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:\n List-Subscribe:List-Post:List-Owner:List-Archive;\n bh=4LGJegvovHPhhXvICzlT+NdspMvN0Ly5n32Uoo6iCmo=; b=IDL8Sstw+f4kLoC+eLvepigY79\n REPes1DZrc0yyoB08/gYRY9nxuGvjbAOvJdjSWCzSBuI0BbTe5ywdZqpQlyKvUtx06JJ9MKseCaIX\n nqIQaqs0F6N5SO8aci70L7mT0W+S0P4CH7CRHlA6cVuhNslFiKvwC18Ub3ifDdrwEEA73SmRP63aq\n FsxCGPacay5cTo0oE5JLIj2ONN1qjPt+ErqPdbI6ETjkuXkQecJG1zvYK7GfRSCYK27hWVHXgI7e3\n kKHd9jmYIs8Z1rpF4ZaeBrJHPqj5rpltlE7q8A0cpojP0+FxQS65abuqMQwVyKqwBhSaq5WqVzKof\n MFj/mBnA==;",
        "From": "\"Roger Sayle\" <roger@nextmovesoftware.com>",
        "To": "<gcc-patches@gcc.gnu.org>",
        "Subject": "[C++ PATCH] PR c++/124753: ICE on invalid P4 regression",
        "Date": "Sat, 28 Mar 2026 09:46:18 -0000",
        "Message-ID": "<001301dcbe97$baccb7f0$306627d0$@nextmovesoftware.com>",
        "MIME-Version": "1.0",
        "Content-Type": "multipart/mixed;\n boundary=\"----=_NextPart_000_0014_01DCBE97.BACCB7F0\"",
        "X-Mailer": "Microsoft Outlook 16.0",
        "Content-Language": "en-gb",
        "Thread-Index": "Ady+l0Vo4HrOSMM4Ry2cN5fKgsUaqg==",
        "X-AntiAbuse": [
            "This header was added to track abuse,\n please include it with any abuse report",
            "Primary Hostname - server.nextmovesoftware.com",
            "Original Domain - gcc.gnu.org",
            "Originator/Caller UID/GID - [47 12] / [47 12]",
            "Sender Address Domain - nextmovesoftware.com"
        ],
        "X-Get-Message-Sender-Via": "server.nextmovesoftware.com: authenticated_id:\n roger@nextmovesoftware.com",
        "X-Authenticated-Sender": "server.nextmovesoftware.com:\n roger@nextmovesoftware.com",
        "X-Source": "",
        "X-Source-Args": "",
        "X-Source-Dir": "",
        "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": "This patch addresses PR c++/124573 by making finish_enum_value_list more\nrobust to DECL_INITIAL being NULL, which I believe only occurs in the\nevent of an error, and treating it as integer_zero_node for the purposes\nof error recovery.\n\nThis patch has been tested on x86_64-pc-linux-gnu with make bootstrap\nand make -k check with no new failures.  Ok for mainline?\n\n\n2026-03-28  Roger Sayle  <roger@nextmovesoftware.com>\n\ngcc/cp/ChangeLog\n        PR c++/124753\n        * decl.cc (finish_enum_value_list): Defend against DECL_INITIAL\n        being NULL during error recovery.\n\ngcc/testsuite/ChangeLog\n        PR c++/124573\n        * g++.dg/r124573.C: New test case.\n\nRoger\n--",
    "diff": "diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc\nindex 6b210a30b6a..8716d6dd386 100644\n--- a/gcc/cp/decl.cc\n+++ b/gcc/cp/decl.cc\n@@ -19015,7 +19015,7 @@ finish_enum_value_list (tree enumtype)\n \n \t  /* Update the minimum and maximum values, if appropriate.  */\n \t  value = DECL_INITIAL (decl);\n-\t  if (TREE_CODE (value) != INTEGER_CST)\n+\t  if (!value || TREE_CODE (value) != INTEGER_CST)\n \t    value = integer_zero_node;\n \t  /* Figure out what the minimum and maximum values of the\n \t     enumerators are.  */\n@@ -19168,6 +19168,8 @@ finish_enum_value_list (tree enumtype)\n         value = perform_implicit_conversion (underlying_type,\n                                              DECL_INITIAL (decl),\n                                              tf_warning_or_error);\n+      if (!value)\n+\tvalue = integer_zero_node;\n       /* Do not clobber shared ints.  But do share identical enumerators.  */\n       value = fold_convert (enumtype, value);\n \ndiff --git a/gcc/testsuite/g++.dg/pr124573.C b/gcc/testsuite/g++.dg/pr124573.C\nnew file mode 100644\nindex 00000000000..c5136bd3308\n--- /dev/null\n+++ b/gcc/testsuite/g++.dg/pr124573.C\n@@ -0,0 +1,19 @@\n+/* PR c++/124573 */\n+/* { dg-do compile } */\n+/* { dg-options \"-O2\" } */\n+/* { dg-require-effective-target c++11 } */\n+\n+template <typename T>\n+struct A {\n+    enum E : T;\n+};\n+\n+using X = A<int>;\n+\n+template <typename T>\n+enum X::E :  /* { dg-error \"cannot add an enumerator list\" } */\n+  T { e1 };  /* { dg-error \"different underlying type\" } */\n+\n+template <>\n+enum A<int>::E : int {};\n+\n",
    "prefixes": [
        "C++"
    ]
}