]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove std::__is_pointer and std::__is_scalar [PR115497]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Jun 2024 16:26:37 +0000 (17:26 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 21 Jun 2024 16:07:00 +0000 (17:07 +0100)
This removes the std::__is_pointer and std::__is_scalar traits, as they
conflicts with a Clang built-in.

Although Clang has a hack to make the class templates work despite using
reserved names, removing these class templates will allow that hack to
be dropped at some future date.

libstdc++-v3/ChangeLog:

PR libstdc++/115497
* include/bits/cpp_type_traits.h (__is_pointer, __is_scalar):
Remove.
(__is_arithmetic): Do not use __is_pointer in the primary
template. Add partial specialization for pointers.

libstdc++-v3/include/bits/cpp_type_traits.h

index 4d83b9472e61aec43456d0eb01e257fc12d04453..abe0c7603e3e90c1bc5343a35593e75bf16b7bca 100644 (file)
@@ -343,31 +343,6 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3)
     };
 #endif
 
-  //
-  // Pointer types
-  //
-#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
-  template<typename _Tp, bool _IsPtr = __is_pointer(_Tp)>
-    struct __is_pointer : __truth_type<_IsPtr>
-    {
-      enum { __value = _IsPtr };
-    };
-#else
-  template<typename _Tp>
-    struct __is_pointer
-    {
-      enum { __value = 0 };
-      typedef __false_type __type;
-    };
-
-  template<typename _Tp>
-    struct __is_pointer<_Tp*>
-    {
-      enum { __value = 1 };
-      typedef __true_type __type;
-    };
-#endif
-
   //
   // An arithmetic type is an integer type or a floating point type
   //
@@ -376,14 +351,6 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3)
     : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
     { };
 
-  //
-  // A scalar type is an arithmetic type or a pointer type
-  // 
-  template<typename _Tp>
-    struct __is_scalar
-    : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
-    { };
-
   //
   // For use in std::copy and std::find overloads for streambuf iterators.
   //