]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use __is_enum built-in trait
authorKen Matsui <kmatsui@gcc.gnu.org>
Mon, 3 Jul 2023 01:12:30 +0000 (18:12 -0700)
committerKen Matsui <kmatsui@gcc.gnu.org>
Wed, 12 Jul 2023 19:04:20 +0000 (12:04 -0700)
This patch replaces is_enum<T>::value with __is_enum built-in trait in
the type_traits header.

libstdc++-v3/ChangeLog:

* include/std/type_traits (__make_unsigned_selector): Use
__is_enum built-in trait.
(__make_signed_selector): Likewise.
(__underlying_type_impl): Likewise.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/std/type_traits

index 0e7a9c9c7f3e93b4ed4bd24645614606e5730a4a..9f086992ebcc0728658176370e58b7dc0a1ace48 100644 (file)
@@ -1740,7 +1740,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Select between integral and enum: not possible to be both.
   template<typename _Tp,
           bool _IsInt = is_integral<_Tp>::value,
-          bool _IsEnum = is_enum<_Tp>::value>
+          bool _IsEnum = __is_enum(_Tp)>
     class __make_unsigned_selector;
 
   template<typename _Tp>
@@ -1900,7 +1900,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Select between integral and enum: not possible to be both.
   template<typename _Tp,
           bool _IsInt = is_integral<_Tp>::value,
-          bool _IsEnum = is_enum<_Tp>::value>
+          bool _IsEnum = __is_enum(_Tp)>
     class __make_signed_selector;
 
   template<typename _Tp>
@@ -2353,7 +2353,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct __common_type_fold<_CTp, _Rp, void>
     { };
 
-  template<typename _Tp, bool = is_enum<_Tp>::value>
+  template<typename _Tp, bool = __is_enum(_Tp)>
     struct __underlying_type_impl
     {
       using type = __underlying_type(_Tp);