#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
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_construct.h>
#include <bits/utility.h> // in_place_index_t
-#if __cplusplus == 201703L
+#ifndef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
# include <ext/aligned_buffer.h>
-#else
+#endif
+#if __cplusplus >= 202002L
# include <compare>
#endif
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cplusplus >= 202002L && __cpp_concepts
+#ifdef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
// P2231R1 constexpr needs constexpr unions and constrained destructors.
# define __cpp_lib_variant 202106L
#else
# define __cpp_lib_to_chars 201611L
#endif
#define __cpp_lib_unordered_map_try_emplace 201411
-#if __cplusplus == 201703L || ! __cpp_concepts // N.B. updated value in C++20
+#ifndef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
+// N.B. updated value in C++20
# define __cpp_lib_variant 202102L
#endif
#endif
# endif
#define __cpp_lib_to_address 201711L
#define __cpp_lib_to_array 201907L
-#if __cpp_concepts
+#ifdef _GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS
# define __cpp_lib_variant 202106L
#endif
#endif