[libcxx] removes unnecessary traits from has_unique_object_representations (#69241)

`remove_cv_t` and `remove_all_extents_t` are taken care of by the
built-in trait, so we don't need to use them directly.

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
This commit is contained in:
Christopher Di Bella 2024-05-21 01:23:21 -07:00 committed by GitHub
parent fea29ee41d
commit 8b8ad75cc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -11,8 +11,6 @@
#include <__config>
#include <__type_traits/integral_constant.h>
#include <__type_traits/remove_all_extents.h>
#include <__type_traits/remove_cv.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@ -24,10 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
: public integral_constant<bool, __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
: public integral_constant<bool, __has_unique_object_representations(_Tp)> {};
template <class _Tp>
inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value;
inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp);
#endif

View File

@ -99,6 +99,8 @@ int main(int, char**)
test_has_unique_object_representations<unsigned>();
test_has_unique_object_representations<NonEmptyUnion>();
test_has_unique_object_representations<char[3]>();
test_has_unique_object_representations<char[3][4]>();
test_has_unique_object_representations<char[3][4][5]>();
test_has_unique_object_representations<char[]>();