Date: Sun, 1 Dec 2024 11:18:39 GMT From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 26b3990480bd - stable/14 - libcxx-compat: revert llvmorg-19-init-17728-g30cc12cd818d: Message-ID: <202412011118.4B1BIdsi008106@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=26b3990480bdc602af856abdde139713a0ee1873 commit 26b3990480bdc602af856abdde139713a0ee1873 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-08-05 20:17:59 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-12-01 11:17:09 +0000 libcxx-compat: revert llvmorg-19-init-17728-g30cc12cd818d: [libc++] Simplify the implementation of is_null_pointer a bit (#98728) PR: 280562 MFC after: 1 month (cherry picked from commit 0bec0529b1d704f391ec499c39744f521e646a6d) --- .../libcxx/include/__type_traits/is_fundamental.h | 2 +- .../libcxx/include/__type_traits/is_null_pointer.h | 12 +++++++++--- .../llvm-project/libcxx/include/__type_traits/is_scalar.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_fundamental.h b/contrib/llvm-project/libcxx/include/__type_traits/is_fundamental.h index 55f8e41f75f4..57206e0d9deb 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_fundamental.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_fundamental.h @@ -34,7 +34,7 @@ inline constexpr bool is_fundamental_v = __is_fundamental(_Tp); template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental - : public integral_constant<bool, is_void<_Tp>::value || __is_null_pointer_v<_Tp> || is_arithmetic<_Tp>::value> {}; + : public integral_constant<bool, is_void<_Tp>::value || __is_nullptr_t<_Tp>::value || is_arithmetic<_Tp>::value> {}; # if _LIBCPP_STD_VER >= 17 template <class _Tp> diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_null_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/is_null_pointer.h index 9f5697e23268..c666f5f24759 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_null_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_null_pointer.h @@ -11,6 +11,7 @@ #include <__config> #include <__type_traits/integral_constant.h> +#include <__type_traits/remove_cv.h> #include <cstddef> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -20,15 +21,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _Tp> -inline const bool __is_null_pointer_v = __is_same(__remove_cv(_Tp), nullptr_t); +struct __is_nullptr_t_impl : public false_type {}; +template <> +struct __is_nullptr_t_impl<nullptr_t> : public true_type {}; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {}; #if _LIBCPP_STD_VER >= 14 template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_null_pointer : integral_constant<bool, __is_null_pointer_v<_Tp>> {}; +struct _LIBCPP_TEMPLATE_VIS is_null_pointer : public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {}; # if _LIBCPP_STD_VER >= 17 template <class _Tp> -inline constexpr bool is_null_pointer_v = __is_null_pointer_v<_Tp>; +inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value; # endif #endif // _LIBCPP_STD_VER >= 14 diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_scalar.h b/contrib/llvm-project/libcxx/include/__type_traits/is_scalar.h index 455200de4720..15f1c71554f2 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_scalar.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_scalar.h @@ -49,7 +49,7 @@ struct _LIBCPP_TEMPLATE_VIS is_scalar bool, is_arithmetic<_Tp>::value || is_member_pointer<_Tp>::value || is_pointer<_Tp>::value || - __is_null_pointer_v<_Tp> || + __is_nullptr_t<_Tp>::value || __is_block<_Tp>::value || is_enum<_Tp>::value> {}; // clang-format on
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412011118.4B1BIdsi008106>