@@ -810,11 +810,6 @@ namespace std
#undef _GLIBCXX_HAS_BUILTIN
-#if __cplusplus >= 202002L && __cpp_concepts && __GNUC__ >= 12
-// XXX workaround for missing feature test macro for P0848R3 (see P2493R0).
-# define _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS 1
-#endif
-
// PSTL configuration
#if __cplusplus >= 201703L
@@ -44,24 +44,22 @@
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_construct.h>
#include <bits/utility.h> // in_place_index_t
-#ifndef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
-# include <ext/aligned_buffer.h>
-#endif
#if __cplusplus >= 202002L
# include <compare>
#endif
+#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L
+// P2231R1 constexpr needs constexpr unions and constrained destructors.
+# define __cpp_lib_variant 202106L
+#else
+# include <ext/aligned_buffer.h> // Use __aligned_membuf instead of union.
+# define __cpp_lib_variant 202102L
+#endif
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#ifdef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
-// P2231R1 constexpr needs constexpr unions and constrained destructors.
-# define __cpp_lib_variant 202106L
-#else
-# define __cpp_lib_variant 202102L
-#endif
-
template<typename... _Types> class tuple;
template<typename... _Types> class variant;
template <typename> struct hash;
@@ -175,7 +175,7 @@
# define __cpp_lib_to_chars 201611L
#endif
#define __cpp_lib_unordered_map_try_emplace 201411L
-#ifndef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
+#if !(__cplusplus >= 202002L && __cpp_concepts >= 202002L)
// N.B. updated value in C++20
# define __cpp_lib_variant 202102L
#endif
@@ -292,7 +292,7 @@
# endif
#define __cpp_lib_to_address 201711L
#define __cpp_lib_to_array 201907L
-#ifdef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
+#if __cplusplus >= 202002L && __cpp_concepts >= 202002L
# define __cpp_lib_variant 202106L
#endif
#endif