get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227722,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2227722/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260424065244.262557-3-tkaminsk@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": "<20260424065244.262557-3-tkaminsk@redhat.com>",
    "date": "2026-04-24T06:41:10",
    "name": "[v2,3/4] libstdc++: static_assert that static sized range size is less than inplace_vector capacity",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "728010701c50d3e1d1bea4d76eefca268cfe2c11",
    "submitter": {
        "id": 90409,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/90409/?format=api",
        "name": "Tomasz Kamiński",
        "email": "tkaminsk@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260424065244.262557-3-tkaminsk@redhat.com/mbox/",
    "series": [
        {
            "id": 501310,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501310/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501310",
            "date": "2026-04-24T06:41:08",
            "name": "[v2,1/4] libstdc++: Merged concept for ranges with static sized.",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/501310/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227722/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227722/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=ZqeeT0zF;\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=ZqeeT0zF",
            "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\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 4g23d95Wgjz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 16:55:41 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EFB484BB24D2\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 06:55:39 +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 5E9334BB24D4\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 06:52:56 +0000 (GMT)",
            "from mx-prod-mc-03.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-164-lBXSdKcpM6ydVLnkt5xxXg-1; Fri,\n 24 Apr 2026 02:52:52 -0400",
            "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 330861956050; Fri, 24 Apr 2026 06:52:51 +0000 (UTC)",
            "from localhost (unknown [10.44.48.150])\n by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id A741A300757B; Fri, 24 Apr 2026 06:52:50 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org EFB484BB24D2",
            "OpenDKIM Filter v2.11.0 sourceware.org 5E9334BB24D4"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 5E9334BB24D4",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 5E9334BB24D4",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777013576; cv=none;\n b=oSo68oHSeOFLDm2iOkMnH4e+NEJ+f2YNsoIjGekTfuo7YRW08AAIB2mLHjBKaMO3q6aBNlMF7opO9ffXPLcPJpu4nFDeUAVGITqrIoqZCGbEaGzwrolBRL9n/JDzsJ7HgAjVRRPaEqTmDgdzz8eFeoFW3FYTKiFMqYQCJWXBd3U=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777013576; c=relaxed/simple;\n bh=9Lz6hwVmMI3C+Dp/csIjh0fO6mwr7WkoC8imWuB9dLs=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=vYRqB9Y55/MIwC5bysAJd+2pwhCfN56uu/NeeldvhjG8TGZO0M6c4sImpiCYpt9XMJfr5a480J65BDt1ksLemGTbf+gXNuE7X2tNoZb/ucpJ+uss1DzF2DnvOAx1Uh/RE8FqsSDmjja0WOYAJjrau2aE4THNCsms2o06ZGlKbVM=",
        "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=1777013576;\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 in-reply-to:in-reply-to:references:references;\n bh=JepjqzdHeTXa02msVcW9UzkseIfcC50eMppUZSZ3t24=;\n b=ZqeeT0zFscbJ2I4ZW6BZjjjrC+bzeI7z3WqYym2wspniJaTSGsCEATzjF/acdqeJZcWePU\n /WfZT3QmTor3Vbkax6iDJhhbjqu7o8Diuy3qqzhqNsysfv7SHtxAW7o2KbT/kvcOyalx4k\n U4ZL0Gs42+gnkQFFbi0/bGJNYFXQVBM=",
        "X-MC-Unique": "lBXSdKcpM6ydVLnkt5xxXg-1",
        "X-Mimecast-MFC-AGG-ID": "lBXSdKcpM6ydVLnkt5xxXg_1777013571",
        "From": "=?utf-8?q?Tomasz_Kami=C5=84ski?= <tkaminsk@redhat.com>",
        "To": "libstdc++@gcc.gnu.org,\n\tgcc-patches@gcc.gnu.org",
        "Subject": "[PATCH v2 3/4] libstdc++: static_assert that static sized range size\n is less than inplace_vector capacity",
        "Date": "Fri, 24 Apr 2026 08:41:10 +0200",
        "Message-ID": "<20260424065244.262557-3-tkaminsk@redhat.com>",
        "In-Reply-To": "<20260424065244.262557-1-tkaminsk@redhat.com>",
        "References": "\n <CAKvuMXD7w0Psg1NYzgPYvqPg6WdgzSd0_NaU=8-yD6sVzhpGQQ@mail.gmail.com>\n <20260424065244.262557-1-tkaminsk@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "pcJLKsSAZVS0_TA1US238PZ8Tuw5ltpeTMOPB1Of2pQ_1777013571",
        "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": "Resolves LWG 4396. Improve inplace_vector(from_range_t, R&& rg)\n\nThe test case illustrates that views applied to span<T, N> are still statically\nsized, but once applied to array<T, N> are not. This is caused by the fact that\nref_view stores a pointer to array, and deference of unknown pointers does not\nproduce reference to unknown, and simply yield non-constant expressions\n(unknown pointer is not equivalent to pointer to unknown, as it may be null).\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/std/inplace_vector (inplace_vector(std::from_range, __Rg&&)):\n\tAdd static_asserts checking range size.\n\t* testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc: New test.\n\t* testsuite/23_containers/inplace_vector/cons/from_range_neg.cc: New test.\n---\nv2 removes expands test to cover integer-class types as size. Concept change was\nextracted to newly added first patch.\n\nTested on x86_64-linux. OK for trunk?\n\n libstdc++-v3/include/std/inplace_vector       | 16 +++-\n .../inplace_vector/cons/from_iota_neg.cc      | 46 +++++++++++\n .../inplace_vector/cons/from_range_neg.cc     | 78 +++++++++++++++++++\n 3 files changed, 138 insertions(+), 2 deletions(-)\n create mode 100644 libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc\n create mode 100644 libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_range_neg.cc",
    "diff": "diff --git a/libstdc++-v3/include/std/inplace_vector b/libstdc++-v3/include/std/inplace_vector\nindex 0096bd83a17..caf9c203245 100644\n--- a/libstdc++-v3/include/std/inplace_vector\n+++ b/libstdc++-v3/include/std/inplace_vector\n@@ -41,7 +41,7 @@\n #include <optional>\n #include <bits/stdexcept_throw.h>\n #include <bits/range_access.h>\n-#include <bits/ranges_base.h> // borrowed_iterator_t, __detail::__container_compatible_range\n+#include <bits/ranges_base.h> // borrowed_iterator_t, __detail::__container_compatible_range, __static_sized_range\n #include <bits/ranges_util.h> // subrange\n #include <bits/ranges_uninitialized.h>\n #include <bits/stl_construct.h>\n@@ -120,7 +120,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER\n \tconstexpr\n \tinplace_vector(from_range_t, _Rg&& __rg)\n \t: inplace_vector()\n-\t{ append_range(__rg); }\n+\t{ \n+\t  // _GLIBCXX_RESOLVE_LIB_DEFECTS\n+\t  // 4396. Improve inplace_vector(from_range_t, R&& rg)\n+\t  if constexpr (ranges::__static_sized_range<_Rg>)\n+\t    static_assert(ranges::size(__rg) <= _Nm);\n+\n+\t  append_range(__rg);\n+\t}\n \n       constexpr\n       inplace_vector(initializer_list<_Tp> __il)\n@@ -934,6 +941,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER\n \tconstexpr\n \tinplace_vector(from_range_t, _Rg&& __rg)\n \t{\n+\t  // _GLIBCXX_RESOLVE_LIB_DEFECTS\n+\t  // 4396. Improve inplace_vector(from_range_t, R&& rg)\n+\t  if constexpr (ranges::__static_sized_range<_Rg>)\n+\t    static_assert(ranges::size(__rg) == 0);\n+\n \t  if (ranges::begin(__rg) != ranges::end(__rg))\n \t    __throw_bad_alloc();\n \t}\ndiff --git a/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc b/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc\nnew file mode 100644\nindex 00000000000..ae0b96175b7\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc\n@@ -0,0 +1,46 @@\n+// { dg-do compile { target c++26 } }\n+// { dg-require-effective-target int128 }\n+\n+#include <array>\n+#include <ranges>\n+#include <span>\n+#include <inplace_vector>\n+\n+template<typename Int, Int min, Int max = std::numeric_limits<Int>::max()>\n+struct StaticIota : std::ranges::iota_view<Int, Int>\n+{\n+  using Base = std::ranges::iota_view<Int, Int>;\n+  using size_type = std::ranges::range_size_t<Base>;\n+\n+  constexpr StaticIota() noexcept : Base(min, max) {}\n+\n+  constexpr static size_type\n+  size()\n+  { return size_type(max) - size_type(min); }\n+};\n+\n+template<typename Range>\n+constexpr std::ranges::ref_view<Range>\n+ref_view(Range& rg)\n+{ return std::ranges::ref_view<Range>(rg); }\n+\n+void\n+test_all()\n+{\n+  StaticIota<__int128, 0, 12> m12;\n+\n+  std::inplace_vector<int, 15> tm1(std::from_range, m12);\n+  std::inplace_vector<int, 15> tr1(std::from_range, ref_view(m12));\n+\n+  std::inplace_vector<int, 10> tm2(std::from_range, m12); // { dg-error \"(from here|expansion of)\" }\n+  // ref_view is not statically sized due pointer dereference\n+  std::inplace_vector<int, 10> tr2(std::from_range, ref_view(m12));\n+\n+  StaticIota<__int128, 0> mm;\n+\n+  std::inplace_vector<int, 10> tm3(std::from_range, mm); // { dg-error \"(from here|expansion of)\" }\n+  // ref_view is not statically sized due pointer dereference\n+  std::inplace_vector<int, 10> tr3(std::from_range, ref_view(mm));\n+}\n+\n+// { dg-error \"static assertion failed\" \"\" { target *-*-* } 0 }\ndiff --git a/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_range_neg.cc b/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_range_neg.cc\nnew file mode 100644\nindex 00000000000..48d5b4c56f5\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/23_containers/inplace_vector/cons/from_range_neg.cc\n@@ -0,0 +1,78 @@\n+// { dg-do compile { target c++26 } }\n+\n+#include <array>\n+#include <ranges>\n+#include <span>\n+#include <inplace_vector>\n+\n+template<typename Range0>\n+void\n+test_zero(Range0&& r0)\n+{\n+  std::inplace_vector<int, 0> f0(std::from_range, r0);\n+  std::inplace_vector<int, 1> f1(std::from_range, r0);\n+  std::inplace_vector<int, 5> f5(std::from_range, r0);\n+  std::inplace_vector<int, 7> f7(std::from_range, r0);\n+}\n+\n+template<typename Range1>\n+void\n+test_one(Range1&& r1)\n+{\n+  std::inplace_vector<int, 0> f0(std::from_range, r1); // { dg-error \"required from\" }\n+  std::inplace_vector<int, 1> f1(std::from_range, r1);\n+  std::inplace_vector<int, 5> f5(std::from_range, r1);\n+  std::inplace_vector<int, 7> f7(std::from_range, r1);\n+}\n+\n+template<typename Range5>\n+void\n+test_five(Range5&& r5)\n+{\n+  std::inplace_vector<int, 0> f0(std::from_range, r5); // { dg-error \"required from\" }\n+  std::inplace_vector<int, 1> f1(std::from_range, r5); // { dg-error \"required from\" }\n+  std::inplace_vector<int, 3> f3(std::from_range, r5); // { dg-error \"required from\" }\n+  std::inplace_vector<int, 5> f5(std::from_range, r5);\n+  std::inplace_vector<int, 7> f7(std::from_range, r5);\n+}\n+\n+template<typename Range>\n+constexpr std::ranges::ref_view<Range>\n+ref_view(Range& rg)\n+{ return std::ranges::ref_view<Range>(rg); }\n+\n+void\n+test_all()\n+{\n+  std::array<int, 0> a0;\n+  std::span<int, 0> s0(a0);\n+  std::array<int, 1> a1;\n+  std::span<int, 1> s1(a1);\n+  std::array<int, 5> a5;\n+  std::span<int, 5> s5(a5);\n+  std::array<int, 7> a7;\n+  std::span<int, 7> s7(a7);\n+\n+  test_zero(a0);\n+  test_zero(s0);\n+  test_zero(ref_view(a0));\n+  test_zero(std::views::empty<int>);\n+  test_zero(s5 | std::views::adjacent<7> | std::views::elements<0>);\n+  test_zero(a5 | std::views::adjacent<7> | std::views::elements<0>);\n+\n+  test_one(a1); // { dg-error \"from here\" }\n+  test_one(s1); // { dg-error \"from here\" }\n+  // ref_view is not statically sized due pointer dereference\n+  test_one(ref_view(a1));\n+  test_one(a5 | std::views::adjacent<7> | std::views::elements<0>);\n+  test_one(s5 | std::views::adjacent<5> | std::views::elements<0>); // { dg-error \"from here\" }\n+\n+  test_five(a5); // { dg-error \"from here\" }\n+  test_five(s5); // { dg-error \"from here\" }\n+  // ref_view is not statically sized due pointer dereference\n+  test_five(ref_view(a5));\n+  test_five(a7 | std::views::adjacent<3> | std::views::elements<0>);\n+  test_five(s7 | std::views::adjacent<3> | std::views::elements<0>); // { dg-error \"from here\" }\n+}\n+\n+// { dg-error \"static assertion failed\" \"\" { target *-*-* } 0 }\n",
    "prefixes": [
        "v2",
        "3/4"
    ]
}