Skip to content

[libc++][ranges] remove __workaround_52970 #85683

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

Merged
merged 2 commits into from
Mar 20, 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
5 changes: 0 additions & 5 deletions libcxx/include/__concepts/class_or_enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;

// Work around Clang bug https://llvm.org/PR52970
// TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
template <class _Tp>
concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;

#endif // _LIBCPP_STD_VER >= 20

_LIBCPP_END_NAMESPACE_STD
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__ranges/access.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concept __can_borrow = is_lvalue_reference_v<_Tp> || enable_borrowed_range<remov
namespace ranges {
namespace __begin {
template <class _Tp>
concept __member_begin = __can_borrow<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_begin = __can_borrow<_Tp> && requires(_Tp&& __t) {
{ _LIBCPP_AUTO_CAST(__t.begin()) } -> input_or_output_iterator;
};

Expand Down Expand Up @@ -103,7 +103,7 @@ using iterator_t = decltype(ranges::begin(std::declval<_Tp&>()));
namespace ranges {
namespace __end {
template <class _Tp>
concept __member_end = __can_borrow<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_end = __can_borrow<_Tp> && requires(_Tp&& __t) {
typename iterator_t<_Tp>;
{ _LIBCPP_AUTO_CAST(__t.end()) } -> sentinel_for<iterator_t<_Tp>>;
};
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ template <class _Tp>
concept __ptr_to_object = is_pointer_v<_Tp> && is_object_v<remove_pointer_t<_Tp>>;

template <class _Tp>
concept __member_data = __can_borrow<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_data = __can_borrow<_Tp> && requires(_Tp&& __t) {
{ _LIBCPP_AUTO_CAST(__t.data()) } -> __ptr_to_object;
};

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/empty.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __empty {
template <class _Tp>
concept __member_empty = __workaround_52970<_Tp> && requires(_Tp&& __t) { bool(__t.empty()); };
concept __member_empty = requires(_Tp&& __t) { bool(__t.empty()); };

template <class _Tp>
concept __can_invoke_size = !__member_empty<_Tp> && requires(_Tp&& __t) { ranges::size(__t); };
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/rbegin.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __rbegin {
template <class _Tp>
concept __member_rbegin = __can_borrow<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_rbegin = __can_borrow<_Tp> && requires(_Tp&& __t) {
{ _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator;
};

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/rend.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
namespace __rend {
template <class _Tp>
concept __member_rend = __can_borrow<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_rend = __can_borrow<_Tp> && requires(_Tp&& __t) {
ranges::rbegin(__t);
{ _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>;
};
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/size.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template <class _Tp>
concept __size_enabled = !disable_sized_range<remove_cvref_t<_Tp>>;

template <class _Tp>
concept __member_size = __size_enabled<_Tp> && __workaround_52970<_Tp> && requires(_Tp&& __t) {
concept __member_size = __size_enabled<_Tp> && requires(_Tp&& __t) {
{ _LIBCPP_AUTO_CAST(__t.size()) } -> __integer_like;
};

Expand Down