[libcxx-commits] [libcxx] 180bc59 - [libc++] Simplify the implementation of is_unbounded_array a bit (#137716)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 1 06:01:47 PDT 2025


Author: Nikolas Klauser
Date: 2025-05-01T15:01:43+02:00
New Revision: 180bc5916b1dfdf4da8516ed2666de386127e8c6

URL: https://github.com/llvm/llvm-project/commit/180bc5916b1dfdf4da8516ed2666de386127e8c6
DIFF: https://github.com/llvm/llvm-project/commit/180bc5916b1dfdf4da8516ed2666de386127e8c6.diff

LOG: [libc++] Simplify the implementation of is_unbounded_array a bit (#137716)

Added: 
    

Modified: 
    libcxx/include/__type_traits/is_unbounded_array.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__type_traits/is_unbounded_array.h b/libcxx/include/__type_traits/is_unbounded_array.h
index f2ccc15065236..e14809e26a787 100644
--- a/libcxx/include/__type_traits/is_unbounded_array.h
+++ b/libcxx/include/__type_traits/is_unbounded_array.h
@@ -25,19 +25,11 @@ inline const bool __is_unbounded_array_v<_Tp[]> = true;
 
 #if _LIBCPP_STD_VER >= 20
 
-template <class>
-struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : false_type {};
-
-_LIBCPP_DIAGNOSTIC_PUSH
-#  if __has_warning("-Winvalid-specialization")
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
-#  endif
 template <class _Tp>
-struct is_unbounded_array<_Tp[]> : true_type {};
-_LIBCPP_DIAGNOSTIC_POP
+struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array_v<_Tp>> {};
 
 template <class _Tp>
-_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
+_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array_v<_Tp>;
 
 #endif
 


        


More information about the libcxx-commits mailing list