git: 6a3478b85758 - stable/13 - libcxx-compat: revert llvmorg-19-init-17853-g578c6191eff7:
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 01 Dec 2024 12:54:10 UTC
The branch stable/13 has been updated by dim:
URL: https://cgit.FreeBSD.org/src/commit/?id=6a3478b857586892c38db0d0f423f6a8964e837c
commit 6a3478b857586892c38db0d0f423f6a8964e837c
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-05 20:17:17 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-01 12:32:39 +0000
libcxx-compat: revert llvmorg-19-init-17853-g578c6191eff7:
[libc++] Simplify std::is_void (#99033)
PR: 280562
MFC after: 1 month
(cherry picked from commit e8054e44f4caf9c3968dcbf2d16bba37e987237b)
---
.../libcxx/include/__type_traits/is_void.h | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_void.h b/contrib/llvm-project/libcxx/include/__type_traits/is_void.h
index 46316b0d3a53..4c27060530c8 100644
--- a/contrib/llvm-project/libcxx/include/__type_traits/is_void.h
+++ b/contrib/llvm-project/libcxx/include/__type_traits/is_void.h
@@ -11,6 +11,8 @@
#include <__config>
#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
+#include <__type_traits/remove_cv.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -18,14 +20,28 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#if __has_builtin(__is_void)
+
template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_same(__remove_cv(_Tp), void)> {};
+struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> {};
# if _LIBCPP_STD_VER >= 17
template <class _Tp>
-inline constexpr bool is_void_v = __is_same(__remove_cv(_Tp), void);
+inline constexpr bool is_void_v = __is_void(_Tp);
# endif
+#else
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_void : public is_same<__remove_cv_t<_Tp>, void> {};
+
+# if _LIBCPP_STD_VER >= 17
+template <class _Tp>
+inline constexpr bool is_void_v = is_void<_Tp>::value;
+# endif
+
+#endif // __has_builtin(__is_void)
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TYPE_TRAITS_IS_VOID_H