mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 13:26:45 +00:00
[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:
parent
fea29ee41d
commit
8b8ad75cc9
@ -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
|
||||
|
||||
|
@ -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[]>();
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user