diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3e6a7ddb539..4b1b010ae97 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2019-10-11 Jonathan Wakely + * include/std/type_traits (is_same): Replace partial specialization + by using __is_same_as built-in in primary template. + (is_same_v): Use __is_same_as built-in instead of instantiating the + is_same trait. + PR libstdc++/92059 * include/tr2/dynamic_bitset (__dynamic_bitset_base): Define all special member functions as defaulted. Add noexcept to most members. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index dc8a019324d..4de5daa9f06 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -1388,13 +1388,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Type relations. /// is_same - template + template struct is_same - : public false_type { }; - - template - struct is_same<_Tp, _Tp> - : public true_type { }; + : public integral_constant + { }; /// is_base_of template @@ -3158,7 +3155,7 @@ template template inline constexpr size_t extent_v = extent<_Tp, _Idx>::value; template - inline constexpr bool is_same_v = is_same<_Tp, _Up>::value; + inline constexpr bool is_same_v = __is_same_as(_Tp, _Up); template inline constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value; template