From patchwork Sat Jun 8 14:52:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1945495 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZTQvjRHy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VxLfH5Rvfz20Q5 for ; Sun, 9 Jun 2024 00:53:10 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95A6C385DDEF for ; Sat, 8 Jun 2024 14:53:03 +0000 (GMT) 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 5231D3858D20 for ; Sat, 8 Jun 2024 14:52:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5231D3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5231D3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717858361; cv=none; b=el5rIUEc5/xJZK2cHcHKrLAMC00qr6hufV4C6TfsvxAz0J1zpn6ZEmwWXuZqNeRdwlXF6yRx72zvf23DvAFOrTTOxf52quXm9mgVzgHxGgFm3bma51taABBItfTW6Bf4+5K3xvP94QKdca7Sg1uGKvkvtfDaYwfzokB9ir4Z+k0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717858361; c=relaxed/simple; bh=crcRBwfwMniff2g9p4ziREmNwPM80KhuG0OZVaZ67p8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=x8b20fDY/DHYjFxTDQYnmEbQ5E/YoSV2l2fpmC/FOxTxPEX/IjlyAFqHTr4OLtu9MBKRnEohAFT3d+i/2cfjHLbtCBtmF8o7EvtB4/zfdYgJbeGVDmaUNY6wDtDVcGTC5EbNXXcip2X8PH82YwlO+nS6ZY1A0YrmpVd2ULTX2hQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717858359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8ueF4aqtbqNy6A4BxUMvCLZw3vJSHtzT095L2aLskhk=; b=ZTQvjRHytLlXvu/LnGdVV4Jdsv4g/gSRCStF3i5Cq0C53MfBzLg2hBvmFnRyzEx17U3Ylm idJhwSXW5YFJK/HZ0mGL0dsyyUnYRgFPRGoNK0nJrJAeg52vvumcHmrcywxsaYbiTNdTmm 2g3mPTJ7jjECZkUgXgSi0ng17iiVFgY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-ey6ULNlfPaiQoP53D55ZPQ-1; Sat, 08 Jun 2024 10:52:37 -0400 X-MC-Unique: ey6ULNlfPaiQoP53D55ZPQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D385195608E; Sat, 8 Jun 2024 14:52:36 +0000 (UTC) Received: from localhost (unknown [10.39.192.128]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AF97C30000C4; Sat, 8 Jun 2024 14:52:34 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Define __cpp_lib_ranges in Date: Sat, 8 Jun 2024 15:52:14 +0100 Message-ID: <20240608145233.456617-1-jwakely@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-Originator: redhat.com X-Spam-Status: No, score=-10.7 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_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. -- >8 -- The __cpp_lib_ranges macro is missing from . libstdc++-v3/ChangeLog: * include/std/algorithm: Define __glibcxx_want_ranges. * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Check feature test macro in C++20 mode. --- libstdc++-v3/include/std/algorithm | 1 + .../testsuite/25_algorithms/headers/algorithm/synopsis.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm index a4602a8807e..163e6b5dca7 100644 --- a/libstdc++-v3/include/std/algorithm +++ b/libstdc++-v3/include/std/algorithm @@ -67,6 +67,7 @@ #define __glibcxx_want_constexpr_algorithms #define __glibcxx_want_freestanding_algorithm #define __glibcxx_want_parallel_algorithm +#define __glibcxx_want_ranges #define __glibcxx_want_ranges_contains #define __glibcxx_want_ranges_find_last #define __glibcxx_want_ranges_fold diff --git a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc index 8c61a614a47..08a47aa95c3 100644 --- a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc +++ b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc @@ -19,6 +19,14 @@ #include +#if __cplusplus >= 202002L +#ifndef __cpp_lib_ranges +# error "Feature test macro for ranges is missing in " +#elif __cpp_lib_ranges < 201911L +# error "Feature test macro for ranges has wrong value in " +#endif +#endif + namespace std { // 25.1, non-modifying sequence operations: