[libcxx-commits] [libcxx] [libc++] Use __is_array if the builtin is fixed (PR #93037)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 22 07:26:59 PDT 2024


https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/93037

None

>From f4e053c038bb0338deca3aa89a00a02d32a99acc Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 22 May 2024 16:26:39 +0200
Subject: [PATCH] [libc++] Use __is_array if the builtin is fixed

---
 libcxx/include/__type_traits/is_array.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libcxx/include/__type_traits/is_array.h b/libcxx/include/__type_traits/is_array.h
index 5b0e0e6f46b81..dc23de28d2c63 100644
--- a/libcxx/include/__type_traits/is_array.h
+++ b/libcxx/include/__type_traits/is_array.h
@@ -19,9 +19,8 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-// TODO: Clang incorrectly reports that __is_array is true for T[0].
-//       Re-enable the branch once https://llvm.org/PR54705 is fixed.
-#if __has_builtin(__is_array) && 0
+#if __has_builtin(__is_array) &&                                                                                       \
+    (!defined(_LIBCPP_COMPILER_CLANG_BASED) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1900))
 
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> {};



More information about the libcxx-commits mailing list