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.

This is part of making libc++ 21 build with clang 18.

PR:		292067
MFC after:	1 month
This commit is contained in:
Dimitry Andric
2026-01-05 20:54:32 +01:00
committed by Dimitry Andric
parent bb6713d38c
commit a114ece3e6
@@ -34,7 +34,14 @@ struct remove_reference {
template <class _Tp>
using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
#else
# error "remove_reference not implemented!"
// clang-format off
template <class _Tp> struct remove_reference {using type _LIBCPP_NODEBUG = _Tp;};
template <class _Tp> struct remove_reference<_Tp&> {using type _LIBCPP_NODEBUG = _Tp;};
template <class _Tp> struct remove_reference<_Tp&&> {using type _LIBCPP_NODEBUG = _Tp;};
// clang-format on
template <class _Tp>
using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
#endif // __has_builtin(__remove_reference_t)
#if _LIBCPP_STD_VER >= 14