Only use GCC-specific __is_same_as built-in conditionally
authorJonathan Wakely <jwakely@redhat.com>
Wed, 16 Oct 2019 10:26:05 +0000 (11:26 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 16 Oct 2019 10:26:05 +0000 (11:26 +0100)
commit44af818f006a046ffadcfe39e7d475956ae55317
treecb601b79c1cdca52fd0dfccc8addf287e5b99c97
parentbf78ed91a445d188e4368adc30dd5c32d973ed6e
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.

From-SVN: r277058
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/std/concepts
libstdc++-v3/include/std/type_traits