Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libcxx] removes unnecessary traits from has_unique_object_representations #69241

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>>)> {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you've checked that we have tests for const arrays or w/e to make sure the patch is still exercised.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to both questions, but I wouldn't be upset if someone wanted to double check the tests' existence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.pass.cpp, but we seem to be missing a test for a multi-dimensional array.

: 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>();


Expand Down
Loading