From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 A22533898C6C for ; Tue, 29 Mar 2022 09:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A22533898C6C Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-ytcRRSP1O_iN56k2LibXaA-1; Tue, 29 Mar 2022 05:11:37 -0400 X-MC-Unique: ytcRRSP1O_iN56k2LibXaA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4797858F1C; Tue, 29 Mar 2022 09:11:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9EFC4538B7; Tue, 29 Mar 2022 09:11:33 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix incorrect preprocessor conditions in Date: Tue, 29 Mar 2022 10:11:33 +0100 Message-Id: <20220329091133.1611004-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.6 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_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 09:11:41 -0000 Tested powerpc64le-linux, pushed to trunk. -- >8 -- The conditions that guard the feature test macros in should match the main definitions of the macros in other headers. This doesn't matter for GCC, because it supports all the conditions being tested here, but it does matter for non-GCC compilers without the relevant C++20 features. libstdc++-v3/ChangeLog: * include/std/version (__cpp_lib_variant): Fix conditions to match . (__cpp_lib_expected): Fix condition to match . --- libstdc++-v3/include/std/version | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 7dbac23f22d..44b8a9f88b5 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -176,7 +176,7 @@ # define __cpp_lib_to_chars 201611L #endif #define __cpp_lib_unordered_map_try_emplace 201411L -#if !(__cplusplus >= 202002L && __cpp_concepts >= 202002L) +#if !(__cpp_concepts >= 202002L && __cpp_constexpr >= 201811L) // N.B. updated value in C++20 # define __cpp_lib_variant 202102L #endif @@ -293,7 +293,7 @@ # endif #define __cpp_lib_to_address 201711L #define __cpp_lib_to_array 201907L -#if __cplusplus >= 202002L && __cpp_concepts >= 202002L +#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L # define __cpp_lib_variant 202106L #endif #endif @@ -306,7 +306,9 @@ #if _GLIBCXX_HOSTED #define __cpp_lib_adaptor_iterator_pair_constructor 202106L -#define __cpp_lib_expected 202202L +#if __cpp_concepts >= 202002L +# define __cpp_lib_expected 202202L +#endif #define __cpp_lib_invoke_r 202106L #define __cpp_lib_ios_noreplace 202200L #if __cpp_lib_concepts -- 2.34.1