public inbox for
help / color / mirror / Atom feed
From: Jonathan Wakely <>
Subject: [gcc r11-10244] libstdc++: Fix feature test macros in <version> for freestanding
Date: Wed,  7 Sep 2022 17:49:41 +0000 (GMT)	[thread overview]
Message-ID: <> (raw)

commit r11-10244-g6e83459072902d4cb94baeedffac30441091adf9
Author: Jonathan Wakely <>
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
            * 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.

 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
 #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
 #define __cpp_lib_bind_front 201907L
-#if __has_builtin(__builtin_bit_cast)
-# define __cpp_lib_bit_cast 201806L
 // 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
 #define __cpp_lib_string_contains 202011L
 #define __cpp_lib_to_underlying 202102L
 #endif // C++2b
 #endif // C++20
 #endif // C++17

                 reply	other threads:[~2022-09-07 17:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).