Skip to content

Commit 8b8ad75

Browse files
cjdbldionne
andauthored
[libcxx] removes unnecessary traits from has_unique_object_representations (llvm#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 <[email protected]>
1 parent fea29ee commit 8b8ad75

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libcxx/include/__type_traits/has_unique_object_representation.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
#include <__config>
1313
#include <__type_traits/integral_constant.h>
14-
#include <__type_traits/remove_all_extents.h>
15-
#include <__type_traits/remove_cv.h>
1614

1715
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1816
# pragma GCC system_header
@@ -24,10 +22,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2422

2523
template <class _Tp>
2624
struct _LIBCPP_TEMPLATE_VIS has_unique_object_representations
27-
: public integral_constant<bool, __has_unique_object_representations(remove_cv_t<remove_all_extents_t<_Tp>>)> {};
25+
: public integral_constant<bool, __has_unique_object_representations(_Tp)> {};
2826

2927
template <class _Tp>
30-
inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value;
28+
inline constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Tp);
3129

3230
#endif
3331

libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ int main(int, char**)
9999
test_has_unique_object_representations<unsigned>();
100100
test_has_unique_object_representations<NonEmptyUnion>();
101101
test_has_unique_object_representations<char[3]>();
102+
test_has_unique_object_representations<char[3][4]>();
103+
test_has_unique_object_representations<char[3][4][5]>();
102104
test_has_unique_object_representations<char[]>();
103105

104106

0 commit comments

Comments
 (0)