-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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,7 +22,7 @@ _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; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Might as well while we're here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very happy to do this if we're okay with doing it elsewhere (I can lead the clean-up for that). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depends on what you mean by "it". If you just mean cases where we always have the builtins available, sure (although I think I removed those cases). In other cases I'm not sure it's a good idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean applying the same change to all other traits where the trait is how the builtin is surfaced (so mostly stuff in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what Nikolas tried explaining is that in most cases, we already call the builtin directly from the |
||||||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.