74-no-builtin_remove_reference_clang14.patch 963 B

12345678910111213141516171819
  1. diff --git a/include/__type_traits/remove_reference.h b/include/__type_traits/remove_reference.h
  2. index ba67891..ef11b16 100644
  3. --- a/include/__type_traits/remove_reference.h
  4. +++ b/include/__type_traits/remove_reference.h
  5. @@ -34,7 +34,13 @@ struct remove_reference {
  6. template <class _Tp>
  7. using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
  8. #else
  9. -# error "remove_reference not implemented!"
  10. +// clang-format off
  11. +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;};
  12. +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;};
  13. +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;};
  14. +// clang-format on
  15. +template <class _Tp>
  16. +using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
  17. #endif // __has_builtin(__remove_reference_t)
  18. #if _LIBCPP_STD_VER >= 14