From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8D7F7384D18D; Wed, 7 Sep 2022 17:49:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D7F7384D18D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662572981; bh=EspxIjPFgEWB9vAsTrVVGYtdnF0Y9RwI07DeaMXhE2g=; h=From:To:Subject:Date:From; b=RMXyc2IcHDCvcJZlSptz08Rvs0CQiqTOzfC40/7Q31SnopNe0zcMvD7Uo9i0HOuNe fS/Kzir9YoYjZ3/Sy7wHdx+ww+0ZS95RGpWd3YjOjaGCLR/CgZxLoSRtCJkVL1uiXq 3j7doyrY3SvlysuZSZbtKxilIQC3GGREChuGU6hc= 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 r11-10244] libstdc++: Fix feature test macros in for freestanding X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: d023d805d9e20c3f46654dc7ea96c9228d650ddb X-Git-Newrev: 6e83459072902d4cb94baeedffac30441091adf9 Message-Id: <20220907174941.8D7F7384D18D@sourceware.org> Date: Wed, 7 Sep 2022 17:49:41 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6e83459072902d4cb94baeedffac30441091adf9 commit r11-10244-g6e83459072902d4cb94baeedffac30441091adf9 Author: Jonathan Wakely Date: Tue Mar 22 21:29:56 2022 +0000 libstdc++: Fix feature test macros in for freestanding Some C++17 and C++20 feature test macros are only defined in for hosted builds, even though the features are supported for freestanding. libstdc++-v3/ChangeLog: * include/std/version [!_GLIBCXX_HOSTED] (__cpp_lib_bit_cast): Define for freestanding. (__cpp_lib_string_contains): Do not define for freestanding. (__cpp_lib_to_underlying): Likewise. 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 f35b9da2307..e86b94bf9dc 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -177,6 +177,9 @@ #define __cpp_lib_atomic_float 201711L #define __cpp_lib_atomic_ref 201806L #define __cpp_lib_atomic_value_initialization 201911L +#if __has_builtin(__builtin_bit_cast) +# define __cpp_lib_bit_cast 201806L +#endif #define __cpp_lib_bitops 201907L #define __cpp_lib_bounded_array_traits 201902L // __cpp_lib_char8_t is defined in @@ -209,9 +212,6 @@ # endif #endif #define __cpp_lib_bind_front 201907L -#if __has_builtin(__builtin_bit_cast) -# define __cpp_lib_bit_cast 201806L -#endif // FIXME: #define __cpp_lib_execution 201902L #define __cpp_lib_integer_comparison_functions 202002L #define __cpp_lib_constexpr_algorithms 201806L @@ -272,8 +272,10 @@ #if __cplusplus > 202002L // c++2b #define __cpp_lib_is_scoped_enum 202011L +#if _GLIBCXX_HOSTED #define __cpp_lib_string_contains 202011L #define __cpp_lib_to_underlying 202102L +#endif #endif // C++2b #endif // C++20 #endif // C++17