get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217995,
    "url": "http://patchwork.ozlabs.org/api/patches/2217995/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/acuDmuim-6Apq7QI@tucnak/",
    "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": "<acuDmuim-6Apq7QI@tucnak>",
    "list_archive_url": null,
    "date": "2026-03-31T08:19:38",
    "name": "libstdc++, v2: Attempt to implement LWG4537 - Improve define_static_array",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "22633fb7945cce37377f8edd828b5672020db9e9",
    "submitter": {
        "id": 671,
        "url": "http://patchwork.ozlabs.org/api/people/671/?format=api",
        "name": "Jakub Jelinek",
        "email": "jakub@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/acuDmuim-6Apq7QI@tucnak/mbox/",
    "series": [
        {
            "id": 498142,
            "url": "http://patchwork.ozlabs.org/api/series/498142/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498142",
            "date": "2026-03-31T08:19:38",
            "name": "libstdc++, v2: Attempt to implement LWG4537 - Improve define_static_array",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498142/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217995/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217995/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=QGDkWy4d;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=QGDkWy4d",
            "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.133.124"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4flLfT1vK9z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 19:20:49 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EA0C04B7A1E7\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 08:20:45 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id C1F6B4BB58C6\n for <gcc-patches@gcc.gnu.org>; Tue, 31 Mar 2026 08:19:47 +0000 (GMT)",
            "from mx-prod-mc-06.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-594-kJcrDGgDMl2A4PI4npTrUg-1; Tue,\n 31 Mar 2026 04:19:43 -0400",
            "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id B3CE6180061D; Tue, 31 Mar 2026 08:19:42 +0000 (UTC)",
            "from tucnak.zalov.cz (unknown [10.44.32.9])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id BC5021955F2E; Tue, 31 Mar 2026 08:19:41 +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 62V8JcZ84075995\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Tue, 31 Mar 2026 10:19:39 +0200",
            "(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 62V8Jc8l4075994;\n Tue, 31 Mar 2026 10:19:38 +0200"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org EA0C04B7A1E7",
            "OpenDKIM Filter v2.11.0 sourceware.org C1F6B4BB58C6"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org C1F6B4BB58C6",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org C1F6B4BB58C6",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774945187; cv=none;\n b=RZ5RT+n56b9m5N2ngtF2EaqgVTxdO24lW3I58261GIMUMwqpRGURslkThAcZLHOkGNYUo27Akcol0HFe7z6xyhOOUHir7qRQqmxiGDGCGJVrEVGzRfpxxjniVzWtx5IaEIu4/Z/Dpu6h4/NvtkFke2jWcjer78D1jsSN5S6gG/4=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774945187; c=relaxed/simple;\n bh=wsjereJ8hJj/ATd9s9xJYKJDs9kvZjwKbC56jocglUQ=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=gASCVvMHc8S0Z+AwFSguOcRU2bHIrMnc7iR7cvSrDlH3nowLXVgWs10NmGcctxjXWaSVKh0HOAmlEnMRNtx60AcMgxRPH9SwG8Uy57lqjPWpWq9Gjca7hZwr/0WpPGrFOXXYEOQ6al1326ZKRh82V6no7bfc+wLEUk6s5VN6TXY=",
        "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=1774945187;\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:in-reply-to:in-reply-to:  references:references;\n bh=uUITrniSF2N7qgsESp6hd2OzkZ4uLUCSasEsnMdC1v0=;\n b=QGDkWy4dxu9tL0h7EWWIifKLdIWdd4NudUK7Tq9zONyAxXzX0mhgNIIWBPiY3DEUNA6mM9\n qaqH5eAJaRP1sm4aPePxswCvZoZzT6bQ2WPTJHfXnMWo40dCoHJhPL+QeMyxmDeYdKBYQD\n 65xms1abXPXqC8+VCfQ4br4bNLeVfis=",
        "X-MC-Unique": "kJcrDGgDMl2A4PI4npTrUg-1",
        "X-Mimecast-MFC-AGG-ID": "kJcrDGgDMl2A4PI4npTrUg_1774945183",
        "Date": "Tue, 31 Mar 2026 10:19:38 +0200",
        "From": "Jakub Jelinek <jakub@redhat.com>",
        "To": "Jonathan Wakely <jwakely@redhat.com>,\n Tomasz Kaminski <tkaminsk@redhat.com>",
        "Cc": "Marek Polacek <polacek@redhat.com>, gcc-patches@gcc.gnu.org,\n libstdc++@gcc.gnu.org",
        "Subject": "[PATCH] libstdc++, v2: Attempt to implement LWG4537 - Improve\n define_static_array",
        "Message-ID": "<acuDmuim-6Apq7QI@tucnak>",
        "References": "<acp75QV2Nfb_qM94@tucnak>\n <CAKvuMXD_EYjO43UPfPTW6fhOY=DUmQM3hqG9f2_2_MC-w2GZtQ@mail.gmail.com>\n <acqrYJmNJSaPpz-t@tucnak>\n <CAKvuMXAgqKdjEnUCBBsjDhpT6x+QvfjBeKr_4BWnU6bjV-WH+Q@mail.gmail.com>",
        "MIME-Version": "1.0",
        "In-Reply-To": "\n <CAKvuMXAgqKdjEnUCBBsjDhpT6x+QvfjBeKr_4BWnU6bjV-WH+Q@mail.gmail.com>",
        "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "LiM6eAtHmaK7v9v7rRWPOYdm1wGs7FLY5MJCzMNOgjM_1774945183",
        "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": "On Mon, Mar 30, 2026 at 07:37:58PM +0200, Tomasz Kaminski wrote:\n> I have patches fixing other LWG issues that need above concept, that\n> are waiting for stage-1. I will handle move and merge then. So let's keep\n> it as is.\n\nOk.  Here is what I've actually bootstrapped/regtested on x86_64-linux\nand i686-linux successfully.  Ok for trunk?\n\n2026-03-31  Jakub Jelinek  <jakub@redhat.com>\n\n\t* include/std/meta (std::meta::__detail::__statically_sized): New\n\tconcept.\n\t(std::meta::define_static_array): Change return type to auto.  If\n\t__statically_sized<_Rg>, return span with ranges::size(__r) as\n\tsecond argument.\n\n\t* g++.dg/reflect/define_static_array1.C (l): Another variable\n\twith define_static_array test from array<int, 0>.\n\tAdd static assertions for types of the define_static_array results.\n\n\n\n\tJakub",
    "diff": "--- libstdc++-v3/include/std/meta.jj\t2026-03-30 12:57:50.289580921 +0200\n+++ libstdc++-v3/include/std/meta\t2026-03-30 18:44:44.485289658 +0200\n@@ -632,18 +632,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       return meta::extract<const ranges::range_value_t<_Rg>*>(__str);\n     }\n \n+  namespace __detail\n+  {\n+    template<typename _Rg>\n+    concept __statically_sized\n+      = requires(_Rg&& __r) {\n+\tstatic_cast<char(*)[static_cast<size_t>(ranges::size(__r))\n+\t\t\t    >= 0]>(nullptr);\n+      };\n+  } // namespace __detail\n+\n   template<ranges::input_range _Rg>\n-    consteval span<const ranges::range_value_t<_Rg>>\n+    consteval auto\n     define_static_array(_Rg&& __r)\n     {\n       using _Tp = ranges::range_value_t<_Rg>;\n       auto __array = meta::reflect_constant_array(__r);\n       auto __type = meta::type_of(__array);\n-      if (meta::is_array_type(__type))\n-\treturn span<const _Tp>(meta::extract<const _Tp*>(__array),\n-\t\t\t       meta::extent(__type, 0U));\n+      if constexpr (__detail::__statically_sized<_Rg>)\n+\t{\n+\t  constexpr size_t __extent = static_cast<size_t>(ranges::size(__r));\n+\t  if constexpr (__extent)\n+\t    return span<const _Tp,\n+\t\t\t__extent>(meta::extract<const _Tp*>(__array),\n+\t\t\t\t  meta::extent(__type, 0U));\n+\t  else\n+\t    return span<const _Tp, 0>();\n+\t}\n       else\n-\treturn span<const _Tp>();\n+\t{\n+\t  if (meta::is_array_type(__type))\n+\t    return span<const _Tp>(meta::extract<const _Tp*>(__array),\n+\t\t\t\t   meta::extent(__type, 0U));\n+\t  else\n+\t    return span<const _Tp>();\n+\t}\n     }\n \n   template<class _Tp>\n--- gcc/testsuite/g++.dg/reflect/define_static_array1.C.jj\t2026-03-27 10:17:16.120298331 +0100\n+++ gcc/testsuite/g++.dg/reflect/define_static_array1.C\t2026-03-30 15:19:15.286549988 +0200\n@@ -22,6 +22,7 @@ constexpr auto h = std::define_static_ar\n constexpr auto i = std::define_static_array (std::vector <V> { V { 1, 2, 3 }, V { 2, 3, 4 }, V { 3, 4, 5 } });\n constexpr auto j = std::define_static_array (std::vector <long long> {});\n constexpr auto k = std::define_static_array (std::meta::nonstatic_data_members_of (^^V, std::meta::access_context::current ()));\n+constexpr auto l = std::define_static_array (std::array <int, 0> {});\n static_assert (a.data () == std::define_static_string (\"abcd\") && a.size () == 5);\n static_assert (b.data () == std::define_static_string (U\"abcd\\0ef\\N{LATIN CAPITAL LETTER AE}\")\n \t       && b.size () == sizeof (U\"abcd\\0ef\\N{LATIN CAPITAL LETTER AE}\") / sizeof (char32_t));\n@@ -40,6 +41,19 @@ static_assert (h.data () == std::define_\n static_assert (i.size () == 3);\n static_assert (j.data () == nullptr && j.size () == 0);\n static_assert (k.size () == 3 && k[0] == ^^V::a && k[1] == ^^V::b && k[2] == ^^V::c);\n+static_assert (l.data () == nullptr && l.size () == 0);\n+static_assert (type_of (^^a) == ^^const std::span <const char, 5>);\n+static_assert (type_of (^^b) == ^^const std::span <const char32_t, sizeof (U\"abcd\\0ef\\N{LATIN CAPITAL LETTER AE}\") / sizeof (char32_t)>);\n+static_assert (type_of (^^c) == ^^const std::span <const char, std::dynamic_extent>);\n+static_assert (type_of (^^d) == ^^const std::span <const int, 4>);\n+static_assert (type_of (^^e) == ^^const std::span <const float, 6>);\n+static_assert (type_of (^^f) == ^^const std::span <const int, std::dynamic_extent>);\n+static_assert (type_of (^^g) == ^^const std::span <const int, std::dynamic_extent>);\n+static_assert (type_of (^^h) == ^^const std::span <const int, std::dynamic_extent>);\n+static_assert (type_of (^^i) == ^^const std::span <const V, std::dynamic_extent>);\n+static_assert (type_of (^^j) == ^^const std::span <const long long, std::dynamic_extent>);\n+static_assert (type_of (^^k) == ^^const std::span <const std::meta::info, std::dynamic_extent>);\n+static_assert (type_of (^^l) == ^^const std::span <const int, 0>);\n \n int\n main ()\n",
    "prefixes": []
}