public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-7779] libstdc++: Fix feature test macros in <version> for freestanding
Date: Wed, 23 Mar 2022 10:11:56 +0000 (GMT)	[thread overview]
Message-ID: <20220323101156.B76073864842@sourceware.org> (raw)

https://gcc.gnu.org/g:bd81327b03dda53e459ef2ef3dc4dea3d04a04e7

commit r12-7779-gbd81327b03dda53e459ef2ef3dc4dea3d04a04e7
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.
    
    All C++23 feature test macros are defined in <version> for freestanding,
    but most of the features are only supported for hosted.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/version [!_GLIBCXX_HOSTED]
            (__cpp_lib_hardware_interference_size): Define for freestanding.
            (__cpp_lib_bit_cast): Likewise.
            (__cpp_lib_is_layout_compatible): Likewise.
            (__cpp_lib_is_pointer_interconvertible): Likewise.
            (__cpp_lib_adaptor_iterator_pair_constructor): Do not define for
            freestanding.
            (__cpp_lib_invoke_r): Likewise.
            (__cpp_lib_ios_noreplace): Likewise.
            (__cpp_lib_monadic_optional): Likewise.
            (__cpp_lib_move_only_function): Likewise.
            (__cpp_lib_spanstream): Likewise.
            (__cpp_lib_stacktrace): Likewise.
            (__cpp_lib_string_contains): Likewise.
            (__cpp_lib_string_resize_and_overwrite): Likewise.
            (__cpp_lib_to_underlying): Likewise.

Diff:
---
 libstdc++-v3/include/std/version | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index d730a7ea3c7..535f095108a 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -108,6 +108,9 @@
 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
 # define __cpp_lib_has_unique_object_representations 201606L
 #endif
+#ifdef __GCC_DESTRUCTIVE_SIZE
+# define __cpp_lib_hardware_interference_size 201703L
+#endif
 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
 # define __cpp_lib_is_aggregate 201703L
 #endif
@@ -142,9 +145,6 @@
 #define __cpp_lib_filesystem 201703L
 #define __cpp_lib_gcd 201606L
 #define __cpp_lib_gcd_lcm 201606L
-#ifdef __GCC_DESTRUCTIVE_SIZE
-# define __cpp_lib_hardware_interference_size 201703L
-#endif
 #define __cpp_lib_hypot 201603L
 #define __cpp_lib_invoke 201411L
 #define __cpp_lib_lcm 201606L
@@ -188,6 +188,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>
@@ -202,7 +205,15 @@
 #ifdef _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
 # define __cpp_lib_is_constant_evaluated 201811L
 #endif
+#if __has_builtin(__is_layout_compatible) \
+  && __has_builtin(__builtin_is_corresponding_member)
+# define __cpp_lib_is_layout_compatible 201907L
+#endif
 #define __cpp_lib_is_nothrow_convertible 201806L
+#if __has_builtin(__is_pointer_interconvertible_base_of) \
+ && __has_builtin(__builtin_is_pointer_interconvertible_with_class)
+# define __cpp_lib_is_pointer_interconvertible 201907L
+#endif
 #define __cpp_lib_remove_cvref 201711L
 #if __has_builtin(__builtin_source_location)
 # define __cpp_lib_source_location 201907L
@@ -224,9 +235,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
@@ -255,14 +263,6 @@
 #ifdef _GLIBCXX_HAS_GTHREADS
 # define __cpp_lib_jthread 201911L
 #endif
-#if __has_builtin(__is_layout_compatible) \
-  && __has_builtin(__builtin_is_corresponding_member)
-# define __cpp_lib_is_layout_compatible 201907L
-#endif
-#if __has_builtin(__is_pointer_interconvertible_base_of) \
- && __has_builtin(__builtin_is_pointer_interconvertible_with_class)
-# define __cpp_lib_is_pointer_interconvertible 201907L
-#endif
 #if __cpp_lib_atomic_wait
 # define __cpp_lib_latch 201907L
 #endif
@@ -300,12 +300,14 @@
 
 #if __cplusplus > 202002L
 // c++2b
-#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 #define __cpp_lib_byteswap 202110L
 #define __cpp_lib_constexpr_typeinfo 202106L
+#define __cpp_lib_is_scoped_enum 202011L
+
+#if _GLIBCXX_HOSTED
+#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
 #define __cpp_lib_invoke_r 202106L
 #define __cpp_lib_ios_noreplace 202200L
-#define __cpp_lib_is_scoped_enum 202011L
 #if __cpp_lib_concepts
 # define __cpp_lib_monadic_optional 202110L
 #endif
@@ -321,6 +323,7 @@
 # define __cpp_lib_string_resize_and_overwrite 202110L
 #endif
 #define __cpp_lib_to_underlying 202102L
+#endif
 #endif // C++2b
 #endif // C++20
 #endif // C++17


                 reply	other threads:[~2022-03-23 10:11 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220323101156.B76073864842@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).