From nobody Thu Jun 01 19:16:49 2023 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 4QXG8d2Zzvz4YyRP; Thu, 1 Jun 2023 19:16:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QXG8d2DWDz3w1l; Thu, 1 Jun 2023 19:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685647009; 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=E2vrqvEd/TwZ4cawlJ+U1wI0wuy6sMEtzbQuEM8V3OI=; b=A2/bTyej0ck+5iJKXzMpM9PDm//kwMGw9nt2pSX8Xw+7dVzhJOcZmn0CmF7k9YzEZ0fSJs /Ih+vaFpRi0jg/Mvuypi/lKH1R83qWQ8w7f48SYHKbnzVycAwLSWPuHGGwe0rDN7FjdwJ+ FTLFhJyEpzAz9TMNKqOVDMLmVFGLjSf6DR6ruF4ZLp6oED8Qfdu0NYxQYrRpLWAJ5cbpyH +5vzpMl0G+znGYj1V1GARYRvKoy0DpInN83PGSt+b4v6DdJ7ffi/SNzhArk7+oWDL72FtF r/dJb6wz8XWaui/TzuZsTnr6YBuUMBkSKwy/eo2gdYB/ikYQ738mXo/p0cH42Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685647009; 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=E2vrqvEd/TwZ4cawlJ+U1wI0wuy6sMEtzbQuEM8V3OI=; b=UTfASNsIq2wyKCSkSAc7N1YN0DxMK6YXuOfSNGWdCRS5EYBV3apAJf3LG2kKbpsARKAwn7 6Rlc4Um287DrPr0wJ9Fz4XQXIFArSIBdzid8CfpF+HBESIQTooNDALnf+U7LT1Vx4JG+mq C2ztgLNbLPX9NEQlAcinPVjOD2vPh18nsdJPL7RaesO8ZAPNfpP37Niurt4/foR02he7/p 4PtLQMxkej/e50gOhLGY0tV+3WVmPFvYzWhnbtY39/DaeKpykhN12dt5AEqzOwVm1r4rD1 u3POwPqjC5rnt1UpzqYJ3nXgJOWfJJ7K5U8ilAKenHHrHPReyMLyrirV83FTvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685647009; a=rsa-sha256; cv=none; b=TjRknb/Iq01VJ8EbfxTjgnXT8WHUqlQimOuAX0KzlaB+am9b6HrV1HMxZF9j2DFLcIsoAw lFFAT38WBOg/r61wrp4sSN9fFDYF9tATr5Dd7Vjltl5lkvv394EBaAJUk05Hd0QMCBPxbe SDujGiogDV7BvDi7Lv6mSMrUSAgcPOywo5ctBxiTVrY3HJegu8izPOZqoA61h2fZHuX9NS nTrawWAgne9KsplBOINv54ynmqVyAlG2qPtok9mZK5OwkG7BCLqP0B56hefG98aY38uXVS QNupRk53EMNsDPn+u8ir5U/R/GJyCu6giHn8LQKRiwsAKXNOx9AvxTcGSiibGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QXG8d1GRBzSyS; Thu, 1 Jun 2023 19:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 351JGnXq081218; Thu, 1 Jun 2023 19:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 351JGnrX081217; Thu, 1 Jun 2023 19:16:49 GMT (envelope-from git) Date: Thu, 1 Jun 2023 19:16:49 GMT Message-Id: <202306011916.351JGnrX081217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 9058186bc1fa - stable/13 - Apply libc++ fix for compiling with clang 16 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9058186bc1fa513a264fe949375f25f0061528eb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9058186bc1fa513a264fe949375f25f0061528eb commit 9058186bc1fa513a264fe949375f25f0061528eb Author: Dimitry Andric AuthorDate: 2023-05-27 16:19:37 +0000 Commit: Dimitry Andric CommitDate: 2023-06-01 19:15:25 +0000 Apply libc++ fix for compiling with clang 16 Merge commit 0e7971154ecb from llvm-project (by Christopher Di Bella): [libcxx][NFC] utilises compiler builtins for unary transform type-traits Depends on D116203 Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D131732 Clang 16 got new builtins that are equivalent to hand-written parts of . When building world with the devel/llvm16 package installed and CROSS_TOOLCHAIN=llvm16 set, this would lead to -Werror warnings about those builtins being overridden. Reported by: emaste MFC after: 3 days (cherry picked from commit 1f571f8767e6e48e7175cdaa27ed11d0c473d4c2) --- .../include/__type_traits/add_lvalue_reference.h | 12 +++++++++++- .../libcxx/include/__type_traits/add_pointer.h | 15 +++++++++++---- .../include/__type_traits/add_rvalue_reference.h | 12 +++++++++++- .../llvm-project/libcxx/include/__type_traits/decay.h | 9 ++++++++- .../libcxx/include/__type_traits/is_referenceable.h | 18 +++++++++++++----- .../libcxx/include/__type_traits/make_signed.h | 19 +++++++++++++------ .../libcxx/include/__type_traits/make_unsigned.h | 19 +++++++++++++------ .../libcxx/include/__type_traits/remove_all_extents.h | 7 +++++++ .../libcxx/include/__type_traits/remove_const.h | 8 ++++++++ .../libcxx/include/__type_traits/remove_cv.h | 8 ++++++++ .../libcxx/include/__type_traits/remove_cvref.h | 5 +++++ .../libcxx/include/__type_traits/remove_extent.h | 7 +++++++ .../libcxx/include/__type_traits/remove_pointer.h | 7 +++++++ .../libcxx/include/__type_traits/remove_reference.h | 7 +++++++ .../libcxx/include/__type_traits/remove_volatile.h | 8 ++++++++ contrib/llvm-project/libcxx/include/type_traits | 4 ++-- 16 files changed, 139 insertions(+), 26 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h index 0d1ee4185c8c..9126caa9c7e9 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h @@ -18,11 +18,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_lvalue_reference) +template +struct add_lvalue_reference { + using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_lvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; }; template struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference {typedef _LIBCPP_NODEBUG typename __add_lvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_lvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; 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 aea2490c5d0c..be3f758da4af 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h @@ -21,16 +21,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__add_pointer) +template +struct add_pointer { + using type _LIBCPP_NODEBUG = __add_pointer(_Tp); +}; +#else template ::value || - _IsSame::type, void>::value> -struct __add_pointer_impl - {typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;}; + bool = __libcpp_is_referenceable<_Tp>::value || _IsSame::type, void>::value> +struct __add_pointer_impl { + typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type; +}; template struct __add_pointer_impl<_Tp, false> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS add_pointer {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_pointer) #if _LIBCPP_STD_VER > 11 template using add_pointer_t = typename add_pointer<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h index b2a1428095d8..be01d4ec5ba8 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h @@ -18,11 +18,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_rvalue_reference) +template +struct add_rvalue_reference { + using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_rvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; }; template struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference {typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_rvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/decay.h b/contrib/llvm-project/libcxx/include/__type_traits/decay.h index 2af0c1ca42c3..ced21d81c815 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/decay.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/decay.h @@ -26,6 +26,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__decay) +template +struct decay { + using type _LIBCPP_NODEBUG = __decay(_Tp); +}; +#else template struct __decay { typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type; @@ -53,8 +59,9 @@ struct _LIBCPP_TEMPLATE_VIS decay private: typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; public: - typedef _LIBCPP_NODEBUG typename __decay<_Up, __is_referenceable<_Up>::value>::type type; + typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type; }; +#endif // __has_builtin(__decay) #if _LIBCPP_STD_VER > 11 template using decay_t = typename decay<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h index b97631cc39dd..4b34ec257231 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h @@ -19,14 +19,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD -struct __is_referenceable_impl { - template static _Tp& __test(int); - template static false_type __test(...); +#if __has_builtin(__is_referenceable) +template +struct __libcpp_is_referenceable : integral_constant {}; +#else +struct __libcpp_is_referenceable_impl { + template + static _Tp& __test(int); + template + static false_type __test(...); }; template -struct __is_referenceable : integral_constant(0)), false_type>::value> {}; +struct __libcpp_is_referenceable + : integral_constant(0)), false_type>::value> { +}; +#endif // __has_builtin(__is_referenceable) _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h index fbc31172a978..c36e2292f16f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h @@ -23,19 +23,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_signed) +template +struct make_signed { + using type _LIBCPP_NODEBUG = __make_signed(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __signed_types; template ::value || is_enum<_Tp>::value> @@ -56,16 +62,17 @@ template <> struct __make_signed< signed long, true> {typedef long ty template <> struct __make_signed {typedef long type;}; template <> struct __make_signed< signed long long, true> {typedef long long type;}; template <> struct __make_signed {typedef long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;}; template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_signed { typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; }; +#endif // __has_builtin(__make_signed) #if _LIBCPP_STD_VER > 11 template using make_signed_t = typename make_signed<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h index 8110a5ca9609..6d4e482a8d97 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h @@ -25,19 +25,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_unsigned) +template +struct make_unsigned { + using type _LIBCPP_NODEBUG = __make_unsigned(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __unsigned_types; template ::value || is_enum<_Tp>::value> @@ -58,16 +64,17 @@ template <> struct __make_unsigned< signed long, true> {typedef unsigned l template <> struct __make_unsigned {typedef unsigned long type;}; template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; template <> struct __make_unsigned {typedef unsigned long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;}; template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_unsigned { typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; }; +#endif // __has_builtin(__make_unsigned) #if _LIBCPP_STD_VER > 11 template using make_unsigned_t = typename make_unsigned<_Tp>::type; 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 075e3acabb44..cc00a61c92b3 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 @@ -18,12 +18,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_all_extents) +template +struct remove_all_extents { + using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_all_extents {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; +#endif // __has_builtin(__remove_all_extents) #if _LIBCPP_STD_VER > 11 template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h index 8efc893e965a..8eefbd099cb3 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h @@ -17,8 +17,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_const) +template +struct remove_const { + using type _LIBCPP_NODEBUG = __remove_const(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; +#endif // __has_builtin(__remove_const) + #if _LIBCPP_STD_VER > 11 template using remove_const_t = typename remove_const<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h index ce1e4e45c6d1..9e3dee6c46ed 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h @@ -19,8 +19,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cv) +template +struct remove_cv { + using type _LIBCPP_NODEBUG = __remove_cv(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_cv {typedef typename remove_volatile::type>::type type;}; +#endif // __has_builtin(__remove_cv) + #if _LIBCPP_STD_VER > 11 template using remove_cv_t = typename remove_cv<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h index d937501fedce..3af261db3949 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h @@ -20,8 +20,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cvref) +template +using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); +#else template using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv::type>::type; +#endif // __has_builtin(__remove_cvref) template struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {}; 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 e353de361616..88da32a4e265 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h @@ -18,12 +18,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_extent) +template +struct remove_extent { + using type _LIBCPP_NODEBUG = __remove_extent(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_extent {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]> {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]> {typedef _Tp type;}; +#endif // __has_builtin(__remove_extent) #if _LIBCPP_STD_VER > 11 template using remove_extent_t = typename remove_extent<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h index 50cde3829470..9042a5250055 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h @@ -17,11 +17,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_pointer) +template +struct remove_pointer { + using type _LIBCPP_NODEBUG = __remove_pointer(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_pointer) #if _LIBCPP_STD_VER > 11 template using remove_pointer_t = typename remove_pointer<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h index a69e48dc584b..7ea7fa52ecc5 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h @@ -18,9 +18,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_reference) +template +struct remove_reference { + using type _LIBCPP_NODEBUG = __remove_reference(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_reference) #if _LIBCPP_STD_VER > 11 template using remove_reference_t = typename remove_reference<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h index 79f64c46a27d..8c7aa6744193 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h @@ -17,8 +17,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_volatile) +template +struct remove_volatile { + using type _LIBCPP_NODEBUG = __remove_volatile(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; +#endif // __has_builtin(__remove_volatile) + #if _LIBCPP_STD_VER > 11 template using remove_volatile_t = typename remove_volatile<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/type_traits b/contrib/llvm-project/libcxx/include/type_traits index 3a086c595f92..dc05f9a44daf 100644 --- a/contrib/llvm-project/libcxx/include/type_traits +++ b/contrib/llvm-project/libcxx/include/type_traits @@ -679,7 +679,7 @@ struct _LIBCPP_TEMPLATE_VIS is_swappable_with template struct _LIBCPP_TEMPLATE_VIS is_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>, @@ -697,7 +697,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with template struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_nothrow_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>,