[gcc r11-10244] libstdc++: Fix feature test macros in <version> for freestanding
Jonathan Wakely
redi@gcc.gnu.org
Wed Sep 7 17:49:41 GMT 2022
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
More information about the Gcc-cvs
mailing list