From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2C8AD3840C32; Tue, 29 Mar 2022 09:11:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C8AD3840C32 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7873] libstdc++: Fix incorrect preprocessor conditions in X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 35464c790382b0ed53c6fd5cc07855b0d3644ab9 X-Git-Newrev: 7255d29c577106c14e42a9c3c88fc6fa6b6e4ecf Message-Id: <20220329091117.2C8AD3840C32@sourceware.org> Date: Tue, 29 Mar 2022 09:11:17 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 09:11:17 -0000 https://gcc.gnu.org/g:7255d29c577106c14e42a9c3c88fc6fa6b6e4ecf commit r12-7873-g7255d29c577106c14e42a9c3c88fc6fa6b6e4ecf Author: Jonathan Wakely Date: Mon Mar 28 11:39:21 2022 +0100 libstdc++: Fix incorrect preprocessor conditions in 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 . Diff: --- 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