From nobody Sat Apr 25 14:20:02 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g2sRQ6KBNz6bZMg for ; Sat, 25 Apr 2026 14:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g2sRQ31Krz3J2c for ; Sat, 25 Apr 2026 14:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777126802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pXaLT1/2WAoeXM7OFW8KqKjuslk2CqDndVELlmDEm0=; b=hHkaQYBxuUdNZFNBhp4BTZ7Vy7c4AeDruy76Db0vWql+09WFcudbT7c9SLKiLj2rYdEjYU BvwauBev3kZ9wHzohM4Bqj3wokctAiZBiChjKQu20Nu7DnJKhQCmLeZNMlkEvWMJGfDyLc y9pVj81rMjEUYOSm5bzxMLiAnUJ5vcOF1aw5r2uE2bdj6Vw6eNJxu1/5BD+n9QQSSCfHUa 5rxwQaQ3s/chjFBlrF8F/mc6L3TercrR92PFv7KO2moVIVGWE8JTtAHuu2sBD6dL6CoZQU qK68J6T7Uj/wn9C69QkD6RvNmbZ9ErDJVjLEzlfApireNZuwTQ/rs1eTQBnniw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777126802; a=rsa-sha256; cv=none; b=ThipdcsQF/oN27uw6ouPdImQk/Q/QRCYfALrdU+cWNSYpF/vbSiBmYbxBYj4MVs5pFzk2F 5S6SJYBggeQprj4OZcOq6olt4xHIDW1rwt2DWdu6G9wyIL3Zbd4uR10/+7QjF0OGTKoKxN ZXoA6kHddRbsMxX0XVpRhQUqjSs0xjr2qAOHpEex4nYQUoyvKT3JzfSfPn3meqAWpDt4hs DQn/iZCYTzjMjspgV0Yp09ig2y7W+J1Ly2f2DMO1FyCbJyaEklcX7SuuYNWTvyUR2gTPdb 7HHLpiQ5a6U6Y/WsHcjgCrbHiEcOiaflA3TO8xEzsfVPeq6w9T2RYZu0Lb1dgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777126802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pXaLT1/2WAoeXM7OFW8KqKjuslk2CqDndVELlmDEm0=; b=Enb3Ivn6RPRgH64fPI63t4sqzPYD1utQx66iovNUpyPuZ+TjAuUOnKL4B7kpaPO+jHiF3O wrqopuTNn65ac5RFTJlUdf4VhneFi9GWHBj2nG3L1PVj8iG5M14SsBxKYGikds4mL3hFq7 0IE+h4dWRtCtYqGaIhFK/4p/ygy6iHdOPG/ry+D3OghfKT7/FPMchPAL1GOQ0yEw2QIQul RGqW80x/z9a3lnsvPBItJt+zoU9APqwiQnYrpvjTiPJgYAlSJpOosIk9KEjVKJJw1ZOp4N jCW9ubmGXglpCrCJqU4NDKOuwmd+TdcmyYKYHjfbAjuxt7wKm/2kjBkOnZ+5xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2sRQ2JvTzd0k for ; Sat, 25 Apr 2026 14:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 375ea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Apr 2026 14:20:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: f7bcd8d8c933 - main - libcxx-compat: revert llvmorg-21-init-17684-gae9990ed9651: List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7bcd8d8c9336b97569265e5ad36b73b30357beb Auto-Submitted: auto-generated Date: Sat, 25 Apr 2026 14:20:02 +0000 Message-Id: <69eccd92.375ea.65a0dab2@gitrepo.freebsd.org> The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f7bcd8d8c9336b97569265e5ad36b73b30357beb commit f7bcd8d8c9336b97569265e5ad36b73b30357beb Author: Dimitry Andric AuthorDate: 2026-01-02 20:25:42 +0000 Commit: Dimitry Andric CommitDate: 2026-04-25 14:14:11 +0000 libcxx-compat: revert llvmorg-21-init-17684-gae9990ed9651: [libc++] Remove dead code from (#143854) Since we've upgraded to GCC 15 now, we can remove a bunch of dead code from ``. This is part of making libc++ 21 build with GCC 14. PR: 292067 MFC after: 1 month --- .../libcxx/include/__type_traits/add_pointer.h | 14 +----- .../libcxx/include/__type_traits/add_reference.h | 55 ++++++++++++++++------ .../libcxx/include/__type_traits/decay.h | 44 ++++++++++++++--- .../has_unique_object_representation.h | 8 +++- .../libcxx/include/__type_traits/is_array.h | 24 +++++++++- .../libcxx/include/__type_traits/is_const.h | 20 +++++++- .../libcxx/include/__type_traits/is_pointer.h | 33 +++++++++++++ .../libcxx/include/__type_traits/is_volatile.h | 20 +++++++- .../include/__type_traits/remove_all_extents.h | 21 +++++++-- .../libcxx/include/__type_traits/remove_extent.h | 21 +++++++-- 10 files changed, 213 insertions(+), 47 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h index f595000520ec..f37f9cf5a93c 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h @@ -22,18 +22,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer) && !defined(_LIBCPP_COMPILER_GCC) -template -struct _LIBCPP_NO_SPECIALIZATIONS add_pointer { - using type _LIBCPP_NODEBUG = __add_pointer(_Tp); -}; - -# ifdef _LIBCPP_COMPILER_GCC -template -using __add_pointer_t _LIBCPP_NODEBUG = typename add_pointer<_Tp>::type; -# else template using __add_pointer_t _LIBCPP_NODEBUG = __add_pointer(_Tp); -# endif #else template || is_void<_Tp>::value> @@ -48,13 +38,13 @@ struct __add_pointer_impl<_Tp, false> { template using __add_pointer_t = typename __add_pointer_impl<_Tp>::type; +#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__add_pointer) + template struct _LIBCPP_NO_SPECIALIZATIONS add_pointer { using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>; }; -#endif // !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) - #if _LIBCPP_STD_VER >= 14 template using add_pointer_t = __add_pointer_t<_Tp>; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_reference.h index c6f5d63d26de..98f26f457daf 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_reference.h @@ -10,6 +10,7 @@ #define _LIBCPP___TYPE_TRAITS_ADD_REFERENCE_H #include <__config> +#include <__type_traits/is_referenceable.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -17,36 +18,62 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__add_lvalue_reference) && !defined(_LIBCPP_COMPILER_GCC) + template -struct _LIBCPP_NO_SPECIALIZATIONS add_lvalue_reference { - using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); +using __add_lvalue_reference_t _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); + +#else + +template > +struct __add_lvalue_reference_impl { + using type _LIBCPP_NODEBUG = _Tp; +}; +template +struct __add_lvalue_reference_impl<_Tp, true> { + using type _LIBCPP_NODEBUG = _Tp&; }; -#ifdef _LIBCPP_COMPILER_GCC template -using __add_lvalue_reference_t _LIBCPP_NODEBUG = typename add_lvalue_reference<_Tp>::type; -#else +using __add_lvalue_reference_t = typename __add_lvalue_reference_impl<_Tp>::type; + +#endif // __has_builtin(__add_lvalue_reference) + template -using __add_lvalue_reference_t _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); -#endif +struct _LIBCPP_NO_SPECIALIZATIONS add_lvalue_reference { + using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>; +}; #if _LIBCPP_STD_VER >= 14 template using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>; #endif +#if __has_builtin(__add_rvalue_reference) && !defined(_LIBCPP_COMPILER_GCC) + template -struct _LIBCPP_NO_SPECIALIZATIONS add_rvalue_reference { - using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); +using __add_rvalue_reference_t _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); + +#else + +template > +struct __add_rvalue_reference_impl { + using type _LIBCPP_NODEBUG = _Tp; +}; +template +struct __add_rvalue_reference_impl<_Tp, true> { + using type _LIBCPP_NODEBUG = _Tp&&; }; -#ifdef _LIBCPP_COMPILER_GCC template -using __add_rvalue_reference_t _LIBCPP_NODEBUG = typename add_rvalue_reference<_Tp>::type; -#else +using __add_rvalue_reference_t = typename __add_rvalue_reference_impl<_Tp>::type; + +#endif // __has_builtin(__add_rvalue_reference) + template -using __add_rvalue_reference_t _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); -#endif +struct _LIBCPP_NO_SPECIALIZATIONS add_rvalue_reference { + using type _LIBCPP_NODEBUG = __add_rvalue_reference_t<_Tp>; +}; #if _LIBCPP_STD_VER >= 14 template diff --git a/contrib/llvm-project/libcxx/include/__type_traits/decay.h b/contrib/llvm-project/libcxx/include/__type_traits/decay.h index 661fba53dfaa..1e663fdcd0ed 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/decay.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/decay.h @@ -10,6 +10,14 @@ #define _LIBCPP___TYPE_TRAITS_DECAY_H #include <__config> +#include <__type_traits/add_pointer.h> +#include <__type_traits/conditional.h> +#include <__type_traits/is_array.h> +#include <__type_traits/is_function.h> +#include <__type_traits/is_referenceable.h> +#include <__type_traits/remove_cv.h> +#include <__type_traits/remove_extent.h> +#include <__type_traits/remove_reference.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -17,18 +25,42 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__decay) && !defined(_LIBCPP_COMPILER_GCC) +template +using __decay_t _LIBCPP_NODEBUG = __decay(_Tp); + template struct _LIBCPP_NO_SPECIALIZATIONS decay { - using type _LIBCPP_NODEBUG = __decay(_Tp); + using type _LIBCPP_NODEBUG = __decay_t<_Tp>; }; -#ifdef _LIBCPP_COMPILER_GCC -template -using __decay_t _LIBCPP_NODEBUG = typename decay<_Tp>::type; #else +template +struct __decay { + using type _LIBCPP_NODEBUG = __remove_cv_t<_Up>; +}; + +template +struct __decay<_Up, true> { +public: + using type _LIBCPP_NODEBUG = + __conditional_t::value, + __add_pointer_t<__remove_extent_t<_Up> >, + __conditional_t::value, typename add_pointer<_Up>::type, __remove_cv_t<_Up> > >; +}; + template -using __decay_t _LIBCPP_NODEBUG = __decay(_Tp); -#endif +struct decay { +private: + using _Up _LIBCPP_NODEBUG = __libcpp_remove_reference_t<_Tp>; + +public: + using type _LIBCPP_NODEBUG = typename __decay<_Up, __is_referenceable_v<_Up> >::type; +}; + +template +using __decay_t = typename decay<_Tp>::type; +#endif // __has_builtin(__decay) #if _LIBCPP_STD_VER >= 14 template diff --git a/contrib/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h b/contrib/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h index af9abfe81d41..ba81be6aa19b 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/has_unique_object_representation.h @@ -11,6 +11,7 @@ #include <__config> #include <__type_traits/integral_constant.h> +#include <__type_traits/remove_all_extents.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -22,7 +23,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD template struct _LIBCPP_NO_SPECIALIZATIONS has_unique_object_representations - : integral_constant {}; + // TODO: We work around a Clang and GCC bug in __has_unique_object_representations by using remove_all_extents + // even though it should not be necessary. This was reported to the compilers: + // - Clang: https://github.com/llvm/llvm-project/issues/95311 + // - GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115476 + // remove_all_extents_t can be removed once all the compilers we support have fixed this bug. + : public integral_constant)> {}; template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool has_unique_object_representations_v = diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_array.h b/contrib/llvm-project/libcxx/include/__type_traits/is_array.h index e734d1a3043e..1d94370378c6 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_array.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_array.h @@ -10,6 +10,7 @@ #define _LIBCPP___TYPE_TRAITS_IS_ARRAY_H #include <__config> +#include <__cstddef/size_t.h> #include <__type_traits/integral_constant.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -18,13 +19,32 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__is_array) && \ + (!defined(_LIBCPP_COMPILER_CLANG_BASED) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1900)) + template struct _LIBCPP_NO_SPECIALIZATIONS is_array : _BoolConstant<__is_array(_Tp)> {}; -#if _LIBCPP_STD_VER >= 17 +# if _LIBCPP_STD_VER >= 17 template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_array_v = __is_array(_Tp); -#endif +# endif + +#else + +template +struct is_array : public false_type {}; +template +struct is_array<_Tp[]> : public true_type {}; +template +struct is_array<_Tp[_Np]> : public true_type {}; + +# if _LIBCPP_STD_VER >= 17 +template +inline constexpr bool is_array_v = is_array<_Tp>::value; +# endif + +#endif // __has_builtin(__is_array) _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_const.h b/contrib/llvm-project/libcxx/include/__type_traits/is_const.h index 85cc32bff1ea..4ec354d7f9bf 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_const.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_const.h @@ -18,13 +18,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__is_const) + template struct _LIBCPP_NO_SPECIALIZATIONS is_const : _BoolConstant<__is_const(_Tp)> {}; -#if _LIBCPP_STD_VER >= 17 +# if _LIBCPP_STD_VER >= 17 template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_const_v = __is_const(_Tp); -#endif +# endif + +#else + +template +struct is_const : public false_type {}; +template +struct is_const<_Tp const> : public true_type {}; + +# if _LIBCPP_STD_VER >= 17 +template +inline constexpr bool is_const_v = is_const<_Tp>::value; +# endif + +#endif // __has_builtin(__is_const) _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/is_pointer.h index 1c3a93d1256c..3c58656e0e61 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_pointer.h @@ -11,6 +11,7 @@ #include <__config> #include <__type_traits/integral_constant.h> +#include <__type_traits/remove_cv.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -18,6 +19,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__is_pointer) + template struct _LIBCPP_NO_SPECIALIZATIONS is_pointer : _BoolConstant<__is_pointer(_Tp)> {}; @@ -26,6 +29,36 @@ template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_pointer_v = __is_pointer(_Tp); # endif +#else // __has_builtin(__is_pointer) + +template +struct __libcpp_is_pointer : false_type {}; +template +struct __libcpp_is_pointer<_Tp*> : true_type {}; + +template +struct __libcpp_remove_objc_qualifiers { + typedef _Tp type; +}; +# if __has_feature(objc_arc) +// clang-format off +template struct __libcpp_remove_objc_qualifiers<_Tp __strong> { typedef _Tp type; }; +template struct __libcpp_remove_objc_qualifiers<_Tp __weak> { typedef _Tp type; }; +template struct __libcpp_remove_objc_qualifiers<_Tp __autoreleasing> { typedef _Tp type; }; +template struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; }; +// clang-format on +# endif + +template +struct is_pointer : __libcpp_is_pointer >::type> {}; + +# if _LIBCPP_STD_VER >= 17 +template +inline constexpr bool is_pointer_v = is_pointer<_Tp>::value; +# endif + +#endif // __has_builtin(__is_pointer) + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP___TYPE_TRAITS_IS_POINTER_H diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_volatile.h b/contrib/llvm-project/libcxx/include/__type_traits/is_volatile.h index c654ebba9299..22e9c297c800 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_volatile.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_volatile.h @@ -18,13 +18,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__is_volatile) + template struct _LIBCPP_NO_SPECIALIZATIONS is_volatile : _BoolConstant<__is_volatile(_Tp)> {}; -#if _LIBCPP_STD_VER >= 17 +# if _LIBCPP_STD_VER >= 17 template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_volatile_v = __is_volatile(_Tp); -#endif +# endif + +#else + +template +struct is_volatile : public false_type {}; +template +struct is_volatile<_Tp volatile> : public true_type {}; + +# if _LIBCPP_STD_VER >= 17 +template +inline constexpr bool is_volatile_v = is_volatile<_Tp>::value; +# endif + +#endif // __has_builtin(__is_volatile) _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h index 2663628ee634..2c7aea2bfd18 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h @@ -10,6 +10,7 @@ #define _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H #include <__config> +#include <__cstddef/size_t.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -23,13 +24,25 @@ struct _LIBCPP_NO_SPECIALIZATIONS remove_all_extents { using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp); }; -#ifdef _LIBCPP_COMPILER_GCC template -using __remove_all_extents_t _LIBCPP_NODEBUG = typename remove_all_extents<_Tp>::type; +using __remove_all_extents_t _LIBCPP_NODEBUG = __remove_all_extents(_Tp); #else template -using __remove_all_extents_t _LIBCPP_NODEBUG = __remove_all_extents(_Tp); -#endif +struct remove_all_extents { + typedef _Tp type; +}; +template +struct remove_all_extents<_Tp[]> { + typedef typename remove_all_extents<_Tp>::type type; +}; +template +struct remove_all_extents<_Tp[_Np]> { + typedef typename remove_all_extents<_Tp>::type type; +}; + +template +using __remove_all_extents_t = typename remove_all_extents<_Tp>::type; +#endif // __has_builtin(__remove_all_extents) #if _LIBCPP_STD_VER >= 14 template diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h index 4c43c4d85165..7745af14bdb1 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h @@ -10,6 +10,7 @@ #define _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H #include <__config> +#include <__cstddef/size_t.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -23,13 +24,25 @@ struct _LIBCPP_NO_SPECIALIZATIONS remove_extent { using type _LIBCPP_NODEBUG = __remove_extent(_Tp); }; -#ifdef _LIBCPP_COMPILER_GCC template -using __remove_extent_t _LIBCPP_NODEBUG = typename remove_extent<_Tp>::type; +using __remove_extent_t _LIBCPP_NODEBUG = __remove_extent(_Tp); #else template -using __remove_extent_t _LIBCPP_NODEBUG = __remove_extent(_Tp); -#endif +struct remove_extent { + typedef _Tp type; +}; +template +struct remove_extent<_Tp[]> { + typedef _Tp type; +}; +template +struct remove_extent<_Tp[_Np]> { + typedef _Tp type; +}; + +template +using __remove_extent_t = typename remove_extent<_Tp>::type; +#endif // __has_builtin(__remove_extent) #if _LIBCPP_STD_VER >= 14 template