aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/version
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-01-10 17:28:19 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-01-11 13:22:35 +0000
commit5b417b35824fb5c15e3ee958cb86436b3409ebea (patch)
tree200cfb1337a68b8be3cc6c976272aece4f0ec425 /libstdc++-v3/include/std/version
parent11d3e8f4364b05e2746689c6d0f573594f6ddb74 (diff)
downloadgcc-5b417b35824fb5c15e3ee958cb86436b3409ebea.zip
gcc-5b417b35824fb5c15e3ee958cb86436b3409ebea.tar.gz
gcc-5b417b35824fb5c15e3ee958cb86436b3409ebea.tar.bz2
libstdc++: Make std::variant work with Clang in C++20 mode [PR103891]
Clang has some bugs with destructors that use constraints to be conditionally trivial, so disable the P2231R1 constexpr changes to std::variant unless the compiler is GCC 12 or later. If/when P2493R0 gets accepted and implemented by G++ we can remove the __GNUC__ check and use __cpp_concepts >= 202002 instead. libstdc++-v3/ChangeLog: PR libstdc++/103891 * include/bits/c++config (_GLIBCXX_HAVE_COND_TRIVIAL_SPECIAL_MEMBERS): Define. * include/std/variant (__cpp_lib_variant): Only define C++20 value when the compiler is known to support conditionally trivial destructors. * include/std/version (__cpp_lib_variant): Likewise.
Diffstat (limited to 'libstdc++-v3/include/std/version')
-rw-r--r--libstdc++-v3/include/std/version5
1 files changed, 3 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index f421056..012d78e 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -173,7 +173,8 @@
# 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
@@ -286,7 +287,7 @@
# 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