[{"id":3673552,"web_url":"http://patchwork.ozlabs.org/comment/3673552/","msgid":"<CAKvuMXCT6BdqR2hv3GGbzQEiTyd=nR_127HHFSug97asAQnBbw@mail.gmail.com>","list_archive_url":null,"date":"2026-04-05T09:46:01","subject":"Re: [PATCH] libstdc++: Implement P1789R3: structured bindings for\n std::integer_sequence","submitter":{"id":90409,"url":"http://patchwork.ozlabs.org/api/people/90409/","name":"Tomasz Kaminski","email":"tkaminsk@redhat.com"},"content":"On Sat, Apr 4, 2026 at 7:03 PM Ivan Lazaric <ivan.lazaric1@gmail.com> wrote:\n\n> P1789 enables accessing the sequence values through structured bindings.\n> ```\n> auto [...values] = std::make_index_sequence<10>{};\n> // values is a pack of size 10, and elements 0, 1, 2, ..., 9\n> ```\n>\n> Corresponding C++ draft commit: 3d71a838ed2a1689dd329f964ec4d58152487151\n> Feature-test macro integer_sequence has been bumped to 202511L.\n>\n> libstdc++-v3/ChangeLog:\n>\n>         * include/bits/utility.h:\n>         Implement structured bindings protocol for std::integer_sequence.\n>         * include/bits/version.def: Bump integer_sequence feature-test\n> macro.\n>         * include/bits/version.h: Regenerate.\n>         * testsuite/20_util/integer_sequence/structured_binding.cc: New\n> test.\n>\n> Signed-off-by: Ivan Lazaric <ivan.lazaric1@gmail.com>\n> ---\n> Tested everything under 20_util, including the new test.\n>\n>  libstdc++-v3/include/bits/utility.h           | 28 ++++++++++++++++++\n>  libstdc++-v3/include/bits/version.def         |  5 ++++\n>  libstdc++-v3/include/bits/version.h           |  7 ++++-\n>  .../integer_sequence/structured_binding.cc    | 29 +++++++++++++++++++\n>  4 files changed, 68 insertions(+), 1 deletion(-)\n>  create mode 100644\n> libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n>\n> diff --git a/libstdc++-v3/include/bits/utility.h\n> b/libstdc++-v3/include/bits/utility.h\n> index bd6b18d54dd..159884dd814 100644\n> --- a/libstdc++-v3/include/bits/utility.h\n> +++ b/libstdc++-v3/include/bits/utility.h\n> @@ -150,6 +150,34 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n>        static constexpr size_t size() noexcept { return sizeof...(_Idx); }\n>      };\n>\n> +#if __glibcxx_integer_sequence >= 202511L // C++ >= 26\n> +    template<typename _Tp, _Tp... _Idx>\n> +      struct tuple_size<integer_sequence<_Tp, _Idx...>>\n> +      : integral_constant<size_t, sizeof...(_Idx)> { };\n> +\n> +    template<size_t __i, class _Tp, _Tp... _Idx>\n> +      struct tuple_element<__i, integer_sequence<_Tp, _Idx...>>\n> +      {\n> +       static_assert(__i < sizeof...(_Idx));\n> +       using type = _Tp;\n> +      };\n> +\n> +    template<size_t __i, class _Tp, _Tp... _Idx>\n> +      struct tuple_element<__i, const integer_sequence<_Tp, _Idx...>>\n> +      {\n> +       static_assert(__i < sizeof...(_Idx));\n> +       using type = _Tp;\n> +      };\n> +\n> +    template<size_t __i, class _Tp, _Tp... _Idx>\n> +      constexpr _Tp\n> +      get (integer_sequence<_Tp, _Idx...>) noexcept\n> +      {\n> +       static_assert(__i < sizeof...(_Idx));\n> +       return _Idx...[__i];\n> +      }\n> +#endif // __glibcxx_integer_sequence >= 202511L\n> +\n>    /// Alias template make_integer_sequence\n>    template<typename _Tp, _Tp _Num>\n>      using make_integer_sequence\n> diff --git a/libstdc++-v3/include/bits/version.def\n> b/libstdc++-v3/include/bits/version.def\n> index b89e60d156d..6103f6a41d1 100644\n> --- a/libstdc++-v3/include/bits/version.def\n> +++ b/libstdc++-v3/include/bits/version.def\n> @@ -184,6 +184,11 @@ ftms = {\n>\n>  ftms = {\n>    name = integer_sequence;\n> +  values = {\n> +    v = 202511;\n> +    cxxmin = 26;\n> +    extra_cond = \"__cpp_pack_indexing\";\n> +  };\n>    values = {\n>      v = 201304;\n>      cxxmin = 14;\n> diff --git a/libstdc++-v3/include/bits/version.h\n> b/libstdc++-v3/include/bits/version.h\n> index d73b547e1b0..0de2ad9e5f3 100644\n> --- a/libstdc++-v3/include/bits/version.h\n> +++ b/libstdc++-v3/include/bits/version.h\n> @@ -186,7 +186,12 @@\n>  #undef __glibcxx_want_exchange_function\n>\n>  #if !defined(__cpp_lib_integer_sequence)\n> -# if (__cplusplus >= 201402L)\n> +# if (__cplusplus >  202302L) && (__cpp_pack_indexing)\n> +#  define __glibcxx_integer_sequence 202511L\n> +#  if defined(__glibcxx_want_all) ||\n> defined(__glibcxx_want_integer_sequence)\n> +#   define __cpp_lib_integer_sequence 202511L\n> +#  endif\n> +# elif (__cplusplus >= 201402L)\n>  #  define __glibcxx_integer_sequence 201304L\n>  #  if defined(__glibcxx_want_all) ||\n> defined(__glibcxx_want_integer_sequence)\n>  #   define __cpp_lib_integer_sequence 201304L\n> diff --git\n> a/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n> b/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n> new file mode 100644\n> index 00000000000..b8e9fa1caa1\n> --- /dev/null\n> +++ b/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n> @@ -0,0 +1,29 @@\n> +// { dg-do compile { target c++26 } }\n> +\n> +#include <utility>\n> +\n> +#if __cpp_lib_integer_sequence < 202511L\n> +# error \"Feature-test macro __cpp_lib_integer_sequence is incorrect\"\n> +#endif\n> +\n> +constexpr auto\n> +destructure_sum(auto seq)\n> +{\n> +  auto [...elems] = seq;\n\nThere is already patch for this feature from Matthias Wippic:\nhttps://gcc.gnu.org/pipermail/libstdc++/2025-November/064271.html\n\nHowever, it got stuck because before the Croydon meeting, as currently\nspecified the following is ill-formed:\n  auto  [...elems] == std::make_integer_sequence<10>{};\n(Could you add test like above):\n\nThis was addressed by CWG3135 (\nhttps://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#3135)\nthat was accepted in Croydon, but I do not think we should ship that\nfeature before it is resolved on trunk.\n\n\n+  return (0 + ... + elems);\n\n+}\n> +\n> +using IS1 = std::make_index_sequence<10>;\n> +static_assert(std::tuple_size_v<IS1> == 10);\n> +static_assert(std::is_same_v<std::tuple_element_t<3, IS1>, size_t>);\n> +static_assert(std::get<7>(IS1{}) == 7);\n> +static_assert(destructure_sum(IS1{}) == 45);\n> +\n> +using IS2 = std::integer_sequence<int, 42, 101, -13>;\n> +static_assert(std::tuple_size_v<IS2> == 3);\n> +static_assert(std::is_same_v<std::tuple_element_t<1, IS2>, int>);\n> +static_assert(std::get<2>(IS2{}) == -13);\n> +static_assert(destructure_sum(IS2{}) == 130);\n> +\n> +using IS3 = std::integer_sequence<char>;\n> +static_assert(std::tuple_size_v<IS3> == 0);\n> --\n> 2.43.0\n>\n>","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=PfobcUy1;\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=PfobcUy1","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 4fpSL60rSzz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 19:47:04 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7A17F4BA23FD\n\tfor <incoming@patchwork.ozlabs.org>; Sun,  5 Apr 2026 09:47:02 +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 6CC364BA2E25\n for <gcc-patches@gcc.gnu.org>; Sun,  5 Apr 2026 09:46:16 +0000 (GMT)","from mail-yw1-f198.google.com (mail-yw1-f198.google.com\n [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-202-pux8wZptMMaHStONYhOqdg-1; Sun, 05 Apr 2026 05:46:13 -0400","by mail-yw1-f198.google.com with SMTP id\n 00721157ae682-790afc07667so39834787b3.0\n for <gcc-patches@gcc.gnu.org>; Sun, 05 Apr 2026 02:46:13 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 7A17F4BA23FD","OpenDKIM Filter v2.11.0 sourceware.org 6CC364BA2E25"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 6CC364BA2E25","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 6CC364BA2E25","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775382376; cv=none;\n b=OldSHymT0uRQMHF8jq3G77bWn0o+t8XCuzMOGAwI1OEj8LYGreLGxApbaAqJKPAlIajIYGdkADJHsqwdZOGAdzlQAKaF67+1QM9WYx6favFm/4DfwbyMSbGqaqyFpaUH3pXVWqKr1V95vB4v2r5R5PAUVzS1i+L8br5rAUI1qmQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775382376; c=relaxed/simple;\n bh=RdGSwmj+VIvLQJtc4iZdOJhBgij43O3KEBDzUWtoi08=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=p9V/n01nqg739g3ZjQJ/Bzt5jb/aHhkjT2eNw05ygkcToeeMxlw9Vhuwr6G0jvCqSm0N1GR0OPhEWBYAsRI25dE1YG7GeeQu+2Bqj9x/qYEfcqNqKO5BLtBXtgAaNo5LYpxaKzS/K5FWKr2SCXhdOQBFeIOQZUGZ7ZEKu3Sx2W4=","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=1775382375;\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=mGl7+4dCdiFP4jAc00Xuq+hPB4r3cZm0mqN4osZ1e/4=;\n b=PfobcUy16X7XrQE+qBRr0B+YK6H4sRXvO+xgxwUPRcl49dOfG4cDjGsi38VSboXhx8N7nO\n HZ8o7lBMZQdPp2x1qWYZOw31EfDQ52+RREpshUmNt/CeUS0zj0a0fBZnaSDhhy8UMR5Wfx\n 91peCJ5yv4z/U8vZupUutVUYF7oSwEw=","X-MC-Unique":"pux8wZptMMaHStONYhOqdg-1","X-Mimecast-MFC-AGG-ID":"pux8wZptMMaHStONYhOqdg_1775382373","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775382373; x=1775987173;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=mGl7+4dCdiFP4jAc00Xuq+hPB4r3cZm0mqN4osZ1e/4=;\n b=TYgQI3HJ9Sj0w44Tu+W4kvLnyk/iz2rk9khREF6reqdr2MnlbTggXjWX0+a2JFV07j\n vlw8cZ0DNxu7f8LQOvN5y0QaCN/A8j6yh70QSCWbN1G0CHtc+0LkJ72uW4AmW2ILTjbp\n WxYn4lISUZDjBlTnunHq8outzTS6BWq6QJTGFAkv/JWrJJ0+zaGht5li+0Hqodf8/OrB\n /0X0hi2RrRSFFiX8I/Xq4ySoVbi5v5721aC+kxXW/m+weXJ/2MxSIOMqoWkS2z31IOLd\n o5LNWleKAvQP4VsezY3O51YBRBOb0enAQo3+Pt9eKcMehoB6iWFCWWf0xws0HsyDcG7Z\n 6Q6w==","X-Forwarded-Encrypted":"i=1;\n AJvYcCU8lStSPlYDzF/KE5F5r1HbCEQCxeVw1tXNzfJzP6Kbv95yqwL6P5QojPRIpcw9efNf3bVjqqJzM5IttQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YzhamACH36mGh+iVRaa0JQEuwGagKqAZF4sLSObujzv0jU6Yvip\n r3xWOD4ajbJl/WPsPOy13YBh/cBWc0R6+MyF1A6zw3evnG5RhxbNLgFFKI/Kz9cVR9/DZ7WuEW5\n cNyAaMTIpc1kTZkHFg5i6Evn4socfep+oEvsNeusHIO22DR561rKeTH/okBP15UILINYnXXsFxh\n /8qE7L9J0mmRwtNCyZxYbTLWw0aNGsA9yweA==","X-Gm-Gg":"AeBDieulPI4TLGgI2iRer2Pm3fc1ba5mTtRdIgcOLrMK0tqRgJsgvYXD9gazgm8cb1x\n cTgPLrmtVdoofVNe/peeMq+1SKmEWicfB2PSMowthLN/vNOMuAjPLEWK4X/+9h3ldmxAwfeW2l+\n xht3odEgV+Paw68V1ceVnY1MimX1IHoZ2ltoM6JDfdTWgQiPOTCRzmJRkUq24VgFhPZYMGrmAtG\n xfoHsDlvJ5XXUCECLfUTc8op1qHVdBMWJ0lVrzbBOQtb0NLtSR/f+HICCchnKws7yGe","X-Received":["by 2002:a05:690c:3385:b0:798:6f0b:86b4 with SMTP id\n 00721157ae682-7a4d701c65bmr90622907b3.25.1775382372892;\n Sun, 05 Apr 2026 02:46:12 -0700 (PDT)","by 2002:a05:690c:3385:b0:798:6f0b:86b4 with SMTP id\n 00721157ae682-7a4d701c65bmr90622757b3.25.1775382372407; Sun, 05 Apr 2026\n 02:46:12 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260404170122.2928689-2-ivan.lazaric1@gmail.com>","In-Reply-To":"<20260404170122.2928689-2-ivan.lazaric1@gmail.com>","From":"Tomasz Kaminski <tkaminsk@redhat.com>","Date":"Sun, 5 Apr 2026 11:46:01 +0200","X-Gm-Features":"AQROBzB46jz7wcHm35itx1NupEGhkSUNK2gK0vUq5JOP6I56dBfxNjoZwO8dzc0","Message-ID":"\n <CAKvuMXCT6BdqR2hv3GGbzQEiTyd=nR_127HHFSug97asAQnBbw@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Implement P1789R3: structured bindings for\n std::integer_sequence","To":"Ivan Lazaric <ivan.lazaric1@gmail.com>","Cc":"libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"SIFvPVpF0khByPidNTfFzQzS0PL0GxkxpydlDE_2w14_1775382373","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/alternative; boundary=\"000000000000a64385064eb36b92\"","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"}},{"id":3673562,"web_url":"http://patchwork.ozlabs.org/comment/3673562/","msgid":"<CA+hF1rUGe-W0SBf=O+_HmAkkANqGD=jL7ANbV4rWAtB4SaDG4Q@mail.gmail.com>","list_archive_url":null,"date":"2026-04-05T12:11:07","subject":"Re: [PATCH] libstdc++: Implement P1789R3: structured bindings for\n std::integer_sequence","submitter":{"id":92628,"url":"http://patchwork.ozlabs.org/api/people/92628/","name":"Ivan Lazaric","email":"ivan.lazaric1@gmail.com"},"content":"Will post an updated patch, but wouldn’t pre-CWG3135 wording also work, due\nto lifetime extension?\n\nauto [a, b, c] = std::make_index_sequence<3>{};// as-ifauto seq =\nstd::make_index_sequence<3>{};\nstd::size_t&& a = std::get<0>(seq);\nstd::size_t&& b = std::get<1>(seq);\nstd::size_t&& c = std::get<2>(seq);\n\n\nOn Sun, Apr 5, 2026 at 11:46 AM Tomasz Kaminski <tkaminsk@redhat.com> wrote:\n\n>\n>\n> On Sat, Apr 4, 2026 at 7:03 PM Ivan Lazaric <ivan.lazaric1@gmail.com>\n> wrote:\n>\n>> P1789 enables accessing the sequence values through structured bindings.\n>> ```\n>> auto [...values] = std::make_index_sequence<10>{};\n>> // values is a pack of size 10, and elements 0, 1, 2, ..., 9\n>> ```\n>>\n>> Corresponding C++ draft commit: 3d71a838ed2a1689dd329f964ec4d58152487151\n>> Feature-test macro integer_sequence has been bumped to 202511L.\n>>\n>> libstdc++-v3/ChangeLog:\n>>\n>>         * include/bits/utility.h:\n>>         Implement structured bindings protocol for std::integer_sequence.\n>>         * include/bits/version.def: Bump integer_sequence feature-test\n>> macro.\n>>         * include/bits/version.h: Regenerate.\n>>         * testsuite/20_util/integer_sequence/structured_binding.cc: New\n>> test.\n>>\n>> Signed-off-by: Ivan Lazaric <ivan.lazaric1@gmail.com>\n>> ---\n>> Tested everything under 20_util, including the new test.\n>>\n>>  libstdc++-v3/include/bits/utility.h           | 28 ++++++++++++++++++\n>>  libstdc++-v3/include/bits/version.def         |  5 ++++\n>>  libstdc++-v3/include/bits/version.h           |  7 ++++-\n>>  .../integer_sequence/structured_binding.cc    | 29 +++++++++++++++++++\n>>  4 files changed, 68 insertions(+), 1 deletion(-)\n>>  create mode 100644\n>> libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n>>\n>> diff --git a/libstdc++-v3/include/bits/utility.h\n>> b/libstdc++-v3/include/bits/utility.h\n>> index bd6b18d54dd..159884dd814 100644\n>> --- a/libstdc++-v3/include/bits/utility.h\n>> +++ b/libstdc++-v3/include/bits/utility.h\n>> @@ -150,6 +150,34 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n>>        static constexpr size_t size() noexcept { return sizeof...(_Idx); }\n>>      };\n>>\n>> +#if __glibcxx_integer_sequence >= 202511L // C++ >= 26\n>> +    template<typename _Tp, _Tp... _Idx>\n>> +      struct tuple_size<integer_sequence<_Tp, _Idx...>>\n>> +      : integral_constant<size_t, sizeof...(_Idx)> { };\n>> +\n>> +    template<size_t __i, class _Tp, _Tp... _Idx>\n>> +      struct tuple_element<__i, integer_sequence<_Tp, _Idx...>>\n>> +      {\n>> +       static_assert(__i < sizeof...(_Idx));\n>> +       using type = _Tp;\n>> +      };\n>> +\n>> +    template<size_t __i, class _Tp, _Tp... _Idx>\n>> +      struct tuple_element<__i, const integer_sequence<_Tp, _Idx...>>\n>> +      {\n>> +       static_assert(__i < sizeof...(_Idx));\n>> +       using type = _Tp;\n>> +      };\n>> +\n>> +    template<size_t __i, class _Tp, _Tp... _Idx>\n>> +      constexpr _Tp\n>> +      get (integer_sequence<_Tp, _Idx...>) noexcept\n>> +      {\n>> +       static_assert(__i < sizeof...(_Idx));\n>> +       return _Idx...[__i];\n>> +      }\n>> +#endif // __glibcxx_integer_sequence >= 202511L\n>> +\n>>    /// Alias template make_integer_sequence\n>>    template<typename _Tp, _Tp _Num>\n>>      using make_integer_sequence\n>> diff --git a/libstdc++-v3/include/bits/version.def\n>> b/libstdc++-v3/include/bits/version.def\n>> index b89e60d156d..6103f6a41d1 100644\n>> --- a/libstdc++-v3/include/bits/version.def\n>> +++ b/libstdc++-v3/include/bits/version.def\n>> @@ -184,6 +184,11 @@ ftms = {\n>>\n>>  ftms = {\n>>    name = integer_sequence;\n>> +  values = {\n>> +    v = 202511;\n>> +    cxxmin = 26;\n>> +    extra_cond = \"__cpp_pack_indexing\";\n>> +  };\n>>    values = {\n>>      v = 201304;\n>>      cxxmin = 14;\n>> diff --git a/libstdc++-v3/include/bits/version.h\n>> b/libstdc++-v3/include/bits/version.h\n>> index d73b547e1b0..0de2ad9e5f3 100644\n>> --- a/libstdc++-v3/include/bits/version.h\n>> +++ b/libstdc++-v3/include/bits/version.h\n>> @@ -186,7 +186,12 @@\n>>  #undef __glibcxx_want_exchange_function\n>>\n>>  #if !defined(__cpp_lib_integer_sequence)\n>> -# if (__cplusplus >= 201402L)\n>> +# if (__cplusplus >  202302L) && (__cpp_pack_indexing)\n>> +#  define __glibcxx_integer_sequence 202511L\n>> +#  if defined(__glibcxx_want_all) ||\n>> defined(__glibcxx_want_integer_sequence)\n>> +#   define __cpp_lib_integer_sequence 202511L\n>> +#  endif\n>> +# elif (__cplusplus >= 201402L)\n>>  #  define __glibcxx_integer_sequence 201304L\n>>  #  if defined(__glibcxx_want_all) ||\n>> defined(__glibcxx_want_integer_sequence)\n>>  #   define __cpp_lib_integer_sequence 201304L\n>> diff --git\n>> a/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n>> b/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n>> new file mode 100644\n>> index 00000000000..b8e9fa1caa1\n>> --- /dev/null\n>> +++\n>> b/libstdc++-v3/testsuite/20_util/integer_sequence/structured_binding.cc\n>> @@ -0,0 +1,29 @@\n>> +// { dg-do compile { target c++26 } }\n>> +\n>> +#include <utility>\n>> +\n>> +#if __cpp_lib_integer_sequence < 202511L\n>> +# error \"Feature-test macro __cpp_lib_integer_sequence is incorrect\"\n>> +#endif\n>> +\n>> +constexpr auto\n>> +destructure_sum(auto seq)\n>> +{\n>> +  auto [...elems] = seq;\n>\n> There is already patch for this feature from Matthias Wippic:\n> https://gcc.gnu.org/pipermail/libstdc++/2025-November/064271.html\n>\n> However, it got stuck because before the Croydon meeting, as currently\n> specified the following is ill-formed:\n>   auto  [...elems] == std::make_integer_sequence<10>{};\n> (Could you add test like above):\n>\n> This was addressed by CWG3135 (\n> https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#3135)\n> that was accepted in Croydon, but I do not think we should ship that\n> feature before it is resolved on trunk.\n>\n>\n> +  return (0 + ... + elems);\n>\n> +}\n>> +\n>> +using IS1 = std::make_index_sequence<10>;\n>> +static_assert(std::tuple_size_v<IS1> == 10);\n>> +static_assert(std::is_same_v<std::tuple_element_t<3, IS1>, size_t>);\n>> +static_assert(std::get<7>(IS1{}) == 7);\n>> +static_assert(destructure_sum(IS1{}) == 45);\n>> +\n>> +using IS2 = std::integer_sequence<int, 42, 101, -13>;\n>> +static_assert(std::tuple_size_v<IS2> == 3);\n>> +static_assert(std::is_same_v<std::tuple_element_t<1, IS2>, int>);\n>> +static_assert(std::get<2>(IS2{}) == -13);\n>> +static_assert(destructure_sum(IS2{}) == 130);\n>> +\n>> +using IS3 = std::integer_sequence<char>;\n>> +static_assert(std::tuple_size_v<IS3> == 0);\n>> --\n>> 2.43.0\n>>\n>>","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 (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=LrNlcuAT;\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 (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=LrNlcuAT","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=209.85.210.176"],"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 4fpWYc2r6dz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 22:12:14 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 74C5D4BA2E1C\n\tfor <incoming@patchwork.ozlabs.org>; Sun,  5 Apr 2026 12:12:12 +0000 (GMT)","from mail-pf1-f176.google.com (mail-pf1-f176.google.com\n [209.85.210.176])\n by sourceware.org (Postfix) with ESMTPS id D1FAB4BA2E1C\n for <gcc-patches@gcc.gnu.org>; Sun,  5 Apr 2026 12:11:21 +0000 (GMT)","by mail-pf1-f176.google.com with SMTP id\n d2e1a72fcca58-82418b0178cso1379278b3a.1\n for <gcc-patches@gcc.gnu.org>; Sun, 05 Apr 2026 05:11:21 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 74C5D4BA2E1C","OpenDKIM Filter v2.11.0 sourceware.org D1FAB4BA2E1C"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org D1FAB4BA2E1C","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org D1FAB4BA2E1C","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775391082; cv=pass;\n b=OqltR3peUkFL/hPMq+5uCb4k2TgOkNPdyD7UyZsNrMcrVgVr0hi+bq6oHumYN4/yuumXzxRQjIp6Z3rnC8ZBMv8x1h3SjzkkvjnPAAzAJCHerQtQnHSPYU/csx+Kw72BGyoaZ/X1MEUWx2FDOtJXXmN0GWuBPFQ5IdyZsTyskq4=","i=1; a=rsa-sha256; t=1775391081; cv=none;\n d=google.com; s=arc-20240605;\n b=CXRrJm8S+aE4SN5pAc1Rlal/Aev6NNKPcYQjaZaB9Faodh+/69MzeH5GVY0TdnzsVg\n zdASTls8UPoM+tit3jRc6FLFLvM/1K/6uY0LGYi54xYe3BS+47DIRXTaPcTUSdxjJeWR\n PPA6jN0SNTAGB8+k2Kt+sB6vHgpIwn61pkS1yNAvDBxRtaUbUYW35iWGLqMxUE8/sXAB\n CG9gdaHu82Ka1qZ8ZdGeLBuVV9x31P4NHVFFUYZtSywbVwMl50uqwYyqcn+jv5y2aoPJ\n mdf8vG2LtIJbCEd3IE7t56UoEQyk9MfTE+KIWAUdU9QSdBXOyLYRxqYm5UNI7egiFFbE\n wB9Q=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775391082; c=relaxed/simple;\n bh=jcXiLYgEq0k0QZOOD0I9dCIqVT0oMpDuE4THASDvDrQ=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=gHW+1MjR2/3310PqQQmMquE/EYMlPOHyRoFc9WNW6pH1aq1dX5RliJ8A2+mCX0vjaayZOlhr5aZEoYYQEJe7ucp7redQHWNDRlvpAVDpiuK10afWkPs/JiAch/ZUIrWCSLk8I/I3/A9PGSAsChDlnwX+SUqRsXFVhomrIwfanf0=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=NJzh4MSzfjoXpuu1Rn5PYwK80VmF2vlNT0vqA3F3Mmo=;\n fh=9G3PS6grUa54t0kGAcBoRz0Lm+p4safp2Fm/QZMYv7o=;\n b=XDJyP/IRHJThCpkTnQ/++HLbFkFNGP5/TpBSilQ+id2yeO5E7z7VUl+btQWeOSRqFW\n NFUwtgm2szc4nzkjhEGXDuybQp1A0ckHZYU4pLkroIj4hYDJAte/DI78Jg32iHBWu/Ps\n j1vNneTyPVx0NuphR3Tav2fbUmBl2sYREa+Gvei958EqJiG58wZChsfIo7oeWrxkW0Xu\n swf9xcPFDvN7D6EPadBZTevXxWHrs4/5QxP4VCBu7H8ICFaLQfK7KTebHUAiqQ3Ddxd3\n 4715xGM4zZ75feqaOG0yKBJSs1tkYoCy+DwQEdi64BMsxsingxyoQe3K5N0NEzWVAmEa\n Eneg==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775391081; x=1775995881; darn=gcc.gnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=NJzh4MSzfjoXpuu1Rn5PYwK80VmF2vlNT0vqA3F3Mmo=;\n b=LrNlcuATqaJCkgNPNGdGb88EG+QBcfq3mFokrKi4TH4K09DsRrrVu1Yda1mwGBdIa8\n aNrB0UZxB22XoG6D3JuKw6JG1z8w57u02ru2dDfzca/80rbsvEfGwmppvm4AL+UbIdc9\n wiUTIIccLWI98hM8s8G3ntegCWQPs6FdDJhDhNe2HoSZsP7juMGgWrPOf5m0ozwAqHvw\n 6s3Pch6ZaaEcFI0VhlN2aMoyuqoMIyGboQupWS2c0iSPCnNQnArpHJvCPE4eRtZYpYz9\n 9KY+evaPdYBCrlcydC1n5074ZeN4+s+n6H6nDfd/+TEAWQsR+bsPrt5RIAieMcoNHi7G\n FMMw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775391081; x=1775995881;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=NJzh4MSzfjoXpuu1Rn5PYwK80VmF2vlNT0vqA3F3Mmo=;\n b=XfF7lGfeSiABKhHd1kM5faSLxF7yclr5i9jJTtOHgg+Egak0Pp2YD3ZIvrtIenwI/h\n TozxZ1uogPvCJf1b/efdeRWuIdf8U+yHr9OoLLpeHvEAXvJlyVpAHz0MVpX/wFAlF9Sl\n VgVP6IT9FWKkFEXMbdk2RUN0c0YAeqxKmZt+yhEzalJnId2VrgPHkbrboWsxJceNrUj6\n vdZGVgITpcU4gMPTxUiz+e8ZIjdgueEK0Zx8dPnMDG6uoXqRauFIfQJfr5iSzqNjUN/P\n i452C4k5JpUcd0FkXTlGfsUhXcRqE6rxq1e+LIJGn8SN2UTciOX/ElGJL6Egf2dJu86x\n /e/Q==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWd9Jzj42iUTIjShMBNKxttit8zwlxEV76VvpODPfa1MvigL/kxTr4xAdOood0HIL8GiJIysFjOAGjAQw==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YzaYi3xrIMT/CcHJKLHSgseqQnrvDNBB2tcRF9GztxISV5FLGuy\n R1M3Mi31UzUSBT/mZ/qvvfHudI5L7xYOdtT+cAHgWWbrAFDuGrBFWdo+kZBWFkzZklsDLSILqpJ\n ht0ywAAPTAta5k85CAelz1CWPaaGtCQLfqoYn","X-Gm-Gg":"AeBDieu0djGsKymTihMnwmXTauur0AYunIV3xxOuTPfH/tJmDGGaVVrqbHYSrfXBNyW\n VKJRsJywIFGbROFOGMGIcg+YuNu6JVUiffjpSCJmX5omMpEiODKy9B1Sk0YuRoqAj3SXweP+Db/\n i0knLKYZq8bxkTLaU4w+DvCja95LK8Of+GSjuW9tkNDAPYJQkqlRavDjtf5L5sGWBWN9QCOlHcq\n yqTAM+wnsIMwrF4tHarZKYll4oqWvEIB+UOTfpS7PHc0xlHUelS9iT60SCPLb7fvsVtKqO7yUYH\n 0RC20p8EnbkqU1CKDIXREPoVPhx2uMdXfgu1KlWAAGfIgKv9JFXYiKu4gIMUnghjzjKlbQGsQDw\n omajdF/3+sjHRuxmcf81J8H7ccXKwY5OF8aqMMafjuIE4cKvHWxCIu35xqg==","X-Received":"by 2002:a05:6a00:368a:b0:822:6830:5900 with SMTP id\n d2e1a72fcca58-82d0da2ad95mr7079572b3a.6.1775391080431; Sun, 05 Apr 2026\n 05:11:20 -0700 (PDT)","MIME-Version":"1.0","References":"<20260404170122.2928689-2-ivan.lazaric1@gmail.com>\n <CAKvuMXCT6BdqR2hv3GGbzQEiTyd=nR_127HHFSug97asAQnBbw@mail.gmail.com>","In-Reply-To":"\n <CAKvuMXCT6BdqR2hv3GGbzQEiTyd=nR_127HHFSug97asAQnBbw@mail.gmail.com>","From":"Ivan Lazaric <ivan.lazaric1@gmail.com>","Date":"Sun, 5 Apr 2026 14:11:07 +0200","X-Gm-Features":"AQROBzBSSVsMnKV-HpaWAPKUmr12KDCuIeb2TEvwjcccIKNNw8oIebKYf1ii9vY","Message-ID":"\n <CA+hF1rUGe-W0SBf=O+_HmAkkANqGD=jL7ANbV4rWAtB4SaDG4Q@mail.gmail.com>","Subject":"Re: [PATCH] libstdc++: Implement P1789R3: structured bindings for\n std::integer_sequence","To":"Tomasz Kaminski <tkaminsk@redhat.com>","Cc":"libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org","Content-Type":"multipart/alternative; boundary=\"000000000000afc4ab064eb5729e\"","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"}}]