public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-10244] libstdc++: Fix feature test macros in <version> for freestanding
@ 2022-09-07 17:49 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-09-07 17:49 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:6e83459072902d4cb94baeedffac30441091adf9

commit r11-10244-g6e83459072902d4cb94baeedffac30441091adf9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Mar 22 21:29:56 2022 +0000

    libstdc++: Fix feature test macros in <version> for freestanding
    
    Some C++17 and C++20 feature test macros are only defined in <version>
    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 <bits/c++config.h>
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-07 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 17:49 [gcc r11-10244] libstdc++: Fix feature test macros in <version> for freestanding Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).