aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/c++config
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-10-16 10:26:05 +0000
committerJonathan Wakely <jwakely@redhat.com>2019-10-16 10:26:05 +0000
commitfa577314c501ca5a07a6fd3a6f8a41ba1c689585 (patch)
treecb601b79c1cdca52fd0dfccc8addf287e5b99c97 /libstdc++-v3/include/bits/c++config
parentb74821597c67e73efc9e305a1c1b879f6e221613 (diff)
Only use GCC-specific __is_same_as built-in conditionally
Clang doesn't support __is_same_as but provides __is_same instead. Restore the original implementation (pre r276891) when neither of those built-ins is available. * include/bits/c++config (_GLIBCXX_BUILTIN_IS_SAME_AS): Define to one of __is_same_as or __is_same when available. * include/std/concepts (__detail::__same_as): Use std::is_same_v. * include/std/type_traits (is_same) [_GLIBCXX_BUILTIN_IS_SAME_AS]: Use new macro instead of __is_same_as. (is_same) [!_GLIBCXX_BUILTIN_IS_SAME_AS]: Restore partial specialization. (is_same_v) [_GLIBCXX_BUILTIN_IS_SAME_AS]: Use new macro. (is_same_v) [!_GLIBCXX_BUILTIN_IS_SAME_AS]: Use std::is_same. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/c++config')
-rw-r--r--libstdc++-v3/include/bits/c++config4
1 files changed, 4 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index c8e099aaadd..32db60f39e5 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -633,6 +633,7 @@ namespace std
# define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1
# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
# define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1
+# define _GLIBCXX_BUILTIN_IS_SAME_AS(T, U) __is_same_as(T, U)
# if __GNUC__ >= 9
# define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1
# endif
@@ -650,6 +651,9 @@ namespace std
# if __has_builtin(__builtin_is_constant_evaluated)
# define _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED 1
# endif
+# if ! __is_identifier(__is_same)
+# define _GLIBCXX_BUILTIN_IS_SAME_AS(T, U) __is_same(T, U)
+# endif
#endif // GCC
// PSTL configuration