git: a7b2d7f261b8 - main - libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 23 Oct 2024 18:30:42 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b2d7f261b81d141195c4204fdc4a0dc97a146e commit a7b2d7f261b81d141195c4204fdc4a0dc97a146e Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-08-05 20:26:58 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-23 18:26:45 +0000 libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83: [libc++] Simplify the implementation of remove_reference (#85207) GCC 13 introduced the type trait `__remove_reference`. We can simplify the implementation of `remove_reference` a bit by using it. PR: 280562 MFC after: 1 month --- .../libcxx/include/__type_traits/remove_reference.h | 14 +++++++------- contrib/llvm-project/libcxx/include/cwchar | 4 ---- contrib/llvm-project/libcxx/include/execution | 4 ---- 3 files changed, 7 insertions(+), 15 deletions(-) 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 ba67891758ad..fd66417bd84f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h @@ -10,6 +10,7 @@ #define _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H #include <__config> +#include <cstddef> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -25,16 +26,15 @@ struct remove_reference { template <class _Tp> using __libcpp_remove_reference_t = __remove_reference_t(_Tp); -#elif __has_builtin(__remove_reference) -template <class _Tp> -struct remove_reference { - using type _LIBCPP_NODEBUG = __remove_reference(_Tp); -}; +#else +// clang-format off +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;}; +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;}; +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;}; +// clang-format on template <class _Tp> using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type; -#else -# error "remove_reference not implemented!" #endif // __has_builtin(__remove_reference_t) #if _LIBCPP_STD_VER >= 14 diff --git a/contrib/llvm-project/libcxx/include/cwchar b/contrib/llvm-project/libcxx/include/cwchar index dd16eaeaa07f..7abcc3440947 100644 --- a/contrib/llvm-project/libcxx/include/cwchar +++ b/contrib/llvm-project/libcxx/include/cwchar @@ -258,8 +258,4 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __constexpr_wmemchr(_Tp _LIBCPP_END_NAMESPACE_STD -#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 -# include <cstddef> -#endif - #endif // _LIBCPP_CWCHAR diff --git a/contrib/llvm-project/libcxx/include/execution b/contrib/llvm-project/libcxx/include/execution index 94d434b2e460..822ffa1fd3eb 100644 --- a/contrib/llvm-project/libcxx/include/execution +++ b/contrib/llvm-project/libcxx/include/execution @@ -142,8 +142,4 @@ _LIBCPP_END_NAMESPACE_STD #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && _LIBCPP_STD_VER >= 17 -#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 -# include <cstddef> -#endif - #endif // _LIBCPP_EXECUTION