From patchwork Fri Jan 6 14:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 40155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp866648wrt; Fri, 6 Jan 2023 07:01:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXu4I80K1RLHSvG+9J7XM0GJafVSC8FNVNxntkqzx6Ll0t4wCDEa6fzLa88PxfHsIsK2M8R9 X-Received: by 2002:a05:6402:240d:b0:46d:731f:d726 with SMTP id t13-20020a056402240d00b0046d731fd726mr55064272eda.22.1673017279043; Fri, 06 Jan 2023 07:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673017279; cv=none; d=google.com; s=arc-20160816; b=lT/kl5uvEzZZi+krLABszDizDA2jqsaNQCq42s/rpNs6bXMlbuiqRVTxN7N6NxhKHU Ohij0era/xCLEngA6Wt9gm2mbxLaRbhhWCdnBDGgLEXxUcXeaHtA1Yc0rnmNtNy2/EUK pJPpAiIEMtPqWwyu4NekMZtuPENA/nn+aGZdj0kZJlM72IG5L4PtPaF8sVeFGAkAwCLC 7On6jS7zAXW1Yt9Qfd+9fjTeL7owsZHy25ZVzVQquqPDNnktrdz/ZScRQNKkNjFkh0Wl vRDTyKNmo3q9M3LRVEYw4MTiYe/8YMP5IccY2jPP8Ar9vAV8M/1BJWNdjb6BqNBiKgWz zVIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=wUhk7NozP5FANBR4kq2cFts841efodV+iD+u/chZd38=; b=lB39IW7gZyjfiAAdENFzpbc47KfL/Uheo4ZVpCNjasHfMFMSrEbPD7FSETlV8NVtgQ 1GmRddgpnFducKZVE0ybJltIy+2xDLgfaLoSy+1VtwXoeUiJRg8cOHmat5fFRETQZYEi SZKi5DGvInobS73eiPBWufIYJ94AU4tKW33KkGXyQUZQN6mknxYGJB4f75pd7bflzcLM K91WtHW652zFkw9QuHbnw3XVnCTsHtNeXtOiYaaOZ7pT90WORRKgsX0gLdE7ydB2t1IN JRDfeGzlR6/gOIH1/vZ0znVDiGxoa4Hi0sowoLS9Kjf/FWsyY/Rl2wTmJqhjMcfXDo3/ k5cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=w3UrP6a5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id sb42-20020a1709076daa00b007fcfcf3b8a4si1708486ejc.353.2023.01.06.07.01.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 07:01:19 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=w3UrP6a5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE3ED3858417 for ; Fri, 6 Jan 2023 15:01:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE3ED3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673017277; bh=wUhk7NozP5FANBR4kq2cFts841efodV+iD+u/chZd38=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=w3UrP6a5K43F5UkJS+4f6X5hilNDte1tWE6O7+xHg+eFtoXVIjzDupppkJ3HyBonn uU8MYQNrudvVIigedi558F2gx8b9yp6wBoQU3P0u13y6ZwdFdCUfFdM9rgMShs9sxW ST4kt6lfs9Sl29jeM+GGssbApVQHdDHaTobWIh+I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 47A903858D28 for ; Fri, 6 Jan 2023 14:59:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47A903858D28 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-612-IrUWgcgbOICQYTPgMedI0A-1; Fri, 06 Jan 2023 09:59:57 -0500 X-MC-Unique: IrUWgcgbOICQYTPgMedI0A-1 Received: by mail-qv1-f72.google.com with SMTP id p11-20020ad451cb000000b005319296a239so860397qvq.18 for ; Fri, 06 Jan 2023 06:59:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wUhk7NozP5FANBR4kq2cFts841efodV+iD+u/chZd38=; b=RP9jLvO0fTqqCatxHbHhQsH6ZstxwK7ueFaiLgzIPE8nB0PaKBkUqmk+7tvYsoarKW uqviMh79UfRCeAvePdnFfLagxujSG01L5NHM7LEtFm41gF1+DAvv/SusNSfl0sICG6wF QBVbW6qEmNjI0t4yOCVs5LuGH7ja1LPLor2krJbPlZCU6Mi2fCFz2pc7O8PWBFjLQfR9 iUTMTAw3GLfmrA2zj1o3JvhtClf/ef1ELthDFJc0IlDHy8fjvCeaXetKzcHjLWPN3BdO v1jQWTNtiNzEQ5SO77+/SNh7fIePeNoLA6nRkc3bsmLtOaQfpfbBaxtuIHt7ULj73gkO /6xQ== X-Gm-Message-State: AFqh2krdhyePuP6iZeQErAdi575FiAL8jlQQUbNsB0OSesOTVLod+28V Mp6EWyU8RppwRUL43S/FsrlOJM8BMTdYmUf91PRWwAAPVuxiB0wlxXi2bTeCitxHY8C9JCl4CXH 9aEyx6sYYt2PddAbBbBocPANuTpz2+dVXJGp9EibbXju2LUlSGwvIaciSVhO0PDR/1VU= X-Received: by 2002:ac8:44d7:0:b0:3a5:4fa8:141c with SMTP id b23-20020ac844d7000000b003a54fa8141cmr87114143qto.23.1673017195717; Fri, 06 Jan 2023 06:59:55 -0800 (PST) X-Received: by 2002:ac8:44d7:0:b0:3a5:4fa8:141c with SMTP id b23-20020ac844d7000000b003a54fa8141cmr87114100qto.23.1673017195263; Fri, 06 Jan 2023 06:59:55 -0800 (PST) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id h4-20020ac87764000000b003a7f4c69334sm596618qtu.24.2023.01.06.06.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 06:59:54 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka Subject: [PATCH] libstdc++: Add feature-test macros for implemented C++23 views [PR108260] Date: Fri, 6 Jan 2023 09:59:50 -0500 Message-Id: <20230106145950.3685552-1-ppalka@redhat.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754285766826960538?= X-GMAIL-MSGID: =?utf-8?q?1754285766826960538?= Tested on x86_64-pc-linux-gnu, does this look OK for trunk? PR libstdc++/108620 libstdc++-v3/ChangeLog: * include/bits/utility.h (__cpp_lib_ranges_zip): Define. * include/std/ranges (__cpp_lib_ranges_zip): Define. (__cpp_lib_ranges_chunk): Define. (__cpp_lib_ranges_slide): Define. (__cpp_lib_ranges_chunk_by): Define. (__cpp_lib_ranges_join_with): Define. (__cpp_lib_ranges_repeat): Define. (__cpp_lib_ranges_stride): Define. (__cpp_lib_ranges_cartesian_product): Define. (__cpp_lib_ranges_as_rvalue): Define. * include/std/version: Likewise. * testsuite/20_util/tuple/p2321r2.cc: Test feature-test macro. * testsuite/std/ranges/adaptors/as_rvalue/1.cc: Likewise. * testsuite/std/ranges/adaptors/chunk/1.cc: Likewise. * testsuite/std/ranges/adaptors/chunk_by/1.cc: Likewise. * testsuite/std/ranges/adaptors/join_with/1.cc: Likewise. * testsuite/std/ranges/adaptors/slide/1.cc: Likewise. * testsuite/std/ranges/adaptors/stride/1.cc: Likewise. * testsuite/std/ranges/cartesian_product/1.cc: Likewise. * testsuite/std/ranges/repeat/1.cc: Likewise. * testsuite/std/ranges/zip/1.cc: Likewise. * testsuite/std/ranges/version_c++23.cc: New test. --- libstdc++-v3/include/bits/utility.h | 4 ++ libstdc++-v3/include/std/ranges | 19 ++++++++ libstdc++-v3/include/std/version | 9 ++++ .../testsuite/20_util/tuple/p2321r2.cc | 4 ++ .../std/ranges/adaptors/as_rvalue/1.cc | 4 ++ .../testsuite/std/ranges/adaptors/chunk/1.cc | 4 ++ .../std/ranges/adaptors/chunk_by/1.cc | 4 ++ .../std/ranges/adaptors/join_with/1.cc | 4 ++ .../testsuite/std/ranges/adaptors/slide/1.cc | 4 ++ .../testsuite/std/ranges/adaptors/stride/1.cc | 4 ++ .../std/ranges/cartesian_product/1.cc | 4 ++ libstdc++-v3/testsuite/std/ranges/repeat/1.cc | 4 ++ .../testsuite/std/ranges/version_c++23.cc | 44 +++++++++++++++++++ libstdc++-v3/testsuite/std/ranges/zip/1.cc | 4 ++ 14 files changed, 116 insertions(+) create mode 100644 libstdc++-v3/testsuite/std/ranges/version_c++23.cc diff --git a/libstdc++-v3/include/bits/utility.h b/libstdc++-v3/include/bits/utility.h index 6a192e27836..fac6c7dc3bd 100644 --- a/libstdc++-v3/include/bits/utility.h +++ b/libstdc++-v3/include/bits/utility.h @@ -263,6 +263,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { using type = _Tp1; }; #endif +#if __cplusplus > 202002L +#define __cpp_lib_ranges_zip 202110L // for and +#endif + _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index ba544e116e1..dce7867e977 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -4364,6 +4364,9 @@ namespace views::__adaptor } // namespace views #if __cplusplus > 202002L + +#define __cpp_lib_ranges_zip 202110L + namespace __detail { template @@ -5802,6 +5805,8 @@ namespace views::__adaptor inline constexpr auto pairwise_transform = adjacent_transform<2>; } +#define __cpp_lib_ranges_chunk 202202L + namespace __detail { template @@ -6339,6 +6344,8 @@ namespace views::__adaptor inline constexpr _Chunk chunk; } +#define __cpp_lib_ranges_slide 202202L + namespace __detail { template @@ -6702,6 +6709,8 @@ namespace views::__adaptor inline constexpr _Slide slide; } +#define __cpp_lib_ranges_chunk_by 202202L + template, iterator_t<_Vp>> _Pred> requires view<_Vp> && is_object_v<_Pred> @@ -6895,6 +6904,8 @@ namespace views::__adaptor inline constexpr _ChunkBy chunk_by; } +#define __cpp_lib_ranges_join_with 202202L + namespace __detail { template @@ -7375,6 +7386,8 @@ namespace views::__adaptor inline constexpr _JoinWith join_with; } // namespace views +#define __cpp_lib_ranges_repeat 202207L + template requires (is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> && (__detail::__is_integer_like<_Bound> || same_as<_Bound, unreachable_sentinel_t>)) @@ -7626,6 +7639,8 @@ namespace views::__adaptor } } +#define __cpp_lib_ranges_stride 202207L + template requires view<_Vp> class stride_view : public view_interface> @@ -7977,6 +7992,8 @@ namespace views::__adaptor inline constexpr _Stride stride; } +#define __cpp_lib_ranges_cartesian_product 202207L + namespace __detail { template @@ -8487,6 +8504,8 @@ namespace views::__adaptor inline constexpr _CartesianProduct cartesian_product; } +#define __cpp_lib_ranges_as_rvalue 202207L + template requires view<_Vp> class as_rvalue_view : public view_interface> diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index c1a9896b0c2..5730357793d 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -319,6 +319,15 @@ #define __cpp_lib_reference_from_temporary 202202L #define __cpp_lib_to_underlying 202102L #define __cpp_lib_unreachable 202202L +#define __cpp_lib_ranges_zip 202110L +#define __cpp_lib_ranges_chunk 202202L +#define __cpp_lib_ranges_slide 202202L +#define __cpp_lib_ranges_chunk_by 202202L +#define __cpp_lib_ranges_join_with 202202L +#define __cpp_lib_ranges_repeat 202207L +#define __cpp_lib_ranges_stride 202207L +#define __cpp_lib_ranges_cartesian_product 202207L +#define __cpp_lib_ranges_as_rvalue 202207L #if _GLIBCXX_HOSTED #define __cpp_lib_adaptor_iterator_pair_constructor 202106L diff --git a/libstdc++-v3/testsuite/20_util/tuple/p2321r2.cc b/libstdc++-v3/testsuite/20_util/tuple/p2321r2.cc index 04ac27358eb..ceed38b16ec 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/p2321r2.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/p2321r2.cc @@ -8,6 +8,10 @@ #include #include +#if __cpp_lib_ranges_zip != 202110L +# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in " +#endif + using std::tuple; using std::pair; using std::allocator; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc index 8ca4f50e9d2..fbf0d651366 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/as_rvalue/1.cc @@ -7,6 +7,10 @@ #include #include +#if __cpp_lib_ranges_as_rvalue != 202207L +# error "Feature-test macro __cpp_lib_ranges_as_rvalue has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk/1.cc index 125c88ef853..18b934f99ee 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk/1.cc @@ -7,6 +7,10 @@ #include #include +#if __cpp_lib_ranges_chunk != 202202L +# error "Feature-test macro __cpp_lib_ranges_chunk has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc index d57b127fbc8..cba6fad6f9a 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/chunk_by/1.cc @@ -7,6 +7,10 @@ #include #include +#if __cpp_lib_ranges_chunk_by != 202202L +# error "Feature-test macro __cpp_lib_ranges_chunk_by has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc index 8b9c6c4fc9f..15127c0715f 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc @@ -7,6 +7,10 @@ #include #include +#if __cpp_lib_ranges_join_with != 202202L +# error "Feature-test macro __cpp_lib_ranges_join_with has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; using namespace std::literals; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/slide/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/slide/1.cc index 98560420810..8c015c1162b 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/slide/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/slide/1.cc @@ -7,6 +7,10 @@ #include #include +#if __cpp_lib_ranges_slide != 202202L +# error "Feature-test macro __cpp_lib_ranges_slide has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/stride/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/stride/1.cc index 37ae896014a..92aca35e83f 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/stride/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/stride/1.cc @@ -6,6 +6,10 @@ #include #include +#if __cpp_lib_ranges_stride != 202207L +# error "Feature-test macro __cpp_lib_ranges_stride has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc b/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc index d6e4b538b20..1ec4422e6f3 100644 --- a/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc @@ -6,6 +6,10 @@ #include #include +#if __cpp_lib_ranges_cartesian_product != 202207L +# error "Feature-test macro __cpp_lib_ranges_cartesian_product has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/repeat/1.cc b/libstdc++-v3/testsuite/std/ranges/repeat/1.cc index f9817c99600..2f3ad4522a4 100644 --- a/libstdc++-v3/testsuite/std/ranges/repeat/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/repeat/1.cc @@ -5,6 +5,10 @@ #include #include +#if __cpp_lib_ranges_repeat != 202207L +# error "Feature-test macro __cpp_lib_ranges_repeat has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views; diff --git a/libstdc++-v3/testsuite/std/ranges/version_c++23.cc b/libstdc++-v3/testsuite/std/ranges/version_c++23.cc new file mode 100644 index 00000000000..d9ea9eca6c7 --- /dev/null +++ b/libstdc++-v3/testsuite/std/ranges/version_c++23.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=gnu++23" } +// { dg-do preprocess { target c++23 } } + +#include + +#if __cpp_lib_ranges != 202110L +# error "Feature-test macro __cpp_lib_ranges has wrong value in " +#endif + +#if __cpp_lib_ranges_zip != 202110L +# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in " +#endif + +#if __cpp_lib_ranges_chunk != 202202L +# error "Feature-test macro __cpp_lib_ranges_chunk has wrong value in " +#endif + +#if __cpp_lib_ranges_slide != 202202L +# error "Feature-test macro __cpp_lib_ranges_slide has wrong value in " +#endif + +#if __cpp_lib_ranges_chunk_by != 202202L +# error "Feature-test macro __cpp_lib_ranges_chunk_by has wrong value in " +#endif + +#if __cpp_lib_ranges_join_with != 202202L +# error "Feature-test macro __cpp_lib_ranges_join_with has wrong value in " +#endif + +#if __cpp_lib_ranges_repeat != 202207L +# error "Feature-test macro __cpp_lib_ranges_repeat has wrong value in " +#endif + +#if __cpp_lib_ranges_stride != 202207L +# error "Feature-test macro __cpp_lib_ranges_stride has wrong value in " +#endif + +#if __cpp_lib_ranges_cartesian_product != 202207L +# error "Feature-test macro __cpp_lib_ranges_cartesian_product has wrong value in " +#endif + +#if __cpp_lib_ranges_as_rvalue != 202207L +# error "Feature-test macro __cpp_lib_ranges_as_rvalue has wrong value in " +#endif diff --git a/libstdc++-v3/testsuite/std/ranges/zip/1.cc b/libstdc++-v3/testsuite/std/ranges/zip/1.cc index e9e40fb15eb..8ca386d6563 100644 --- a/libstdc++-v3/testsuite/std/ranges/zip/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/zip/1.cc @@ -8,6 +8,10 @@ #include #include +#if __cpp_lib_ranges_zip != 202110L +# error "Feature-test macro __cpp_lib_ranges_zip has wrong value in " +#endif + namespace ranges = std::ranges; namespace views = std::views;