diff options
author | Christopher Di Bella <cjdb@google.com> | 2024-05-21 01:23:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-21 10:23:21 +0200 |
commit | 8b8ad75cc94aad88c505bdca71c903774f9e75c7 (patch) | |
tree | cbead2b7c9c023cbd9ac98e63b463e567096c29e /libcxx | |
parent | fea29ee41d50c5603338f5af4728ddbdf93aaec2 (diff) | |
download | llvm-8b8ad75cc94aad88c505bdca71c903774f9e75c7.zip llvm-8b8ad75cc94aad88c505bdca71c903774f9e75c7.tar.gz llvm-8b8ad75cc94aad88c505bdca71c903774f9e75c7.tar.bz2 |
[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>
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/__type_traits/has_unique_object_representation.h | 6 | ||||
-rw-r--r-- | libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/__type_traits/has_unique_object_representation.h b/libcxx/include/__type_traits/has_unique_object_representation.h index c0ada56..1aa0449 100644 --- a/libcxx/include/__type_traits/has_unique_object_representation.h +++ b/libcxx/include/__type_traits/has_unique_object_representation.h @@ -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 diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp index ce34c8e..b8b84bb 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp @@ -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[]>(); |