Skip to content

Commit

Permalink
Test for CI fixes.
Browse files Browse the repository at this point in the history
This should fix the CI, however when this works more tests should be
added to avoid regression.
  • Loading branch information
mordante committed Jul 20, 2024
1 parent cd9e497 commit c4db2df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
19 changes: 13 additions & 6 deletions libcxx/include/__iterator/wrap_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define _LIBCPP___ITERATOR_WRAP_ITER_H

#include <__compare/ordering.h>
#include <__concepts/same_as.h>
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
Expand Down Expand Up @@ -120,8 +121,6 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
return __x.base() == __y.base();
}

#if _LIBCPP_STD_VER <= 17

template <class _Iter1>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
Expand Down Expand Up @@ -182,21 +181,29 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
return !(__y < __x);
}

#else // _LIBCPP_STD_VER <= 17
#if _LIBCPP_STD_VER >= 20

template <class _Iter1>
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept {
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept
requires requires(const _Iter1& __i) {
{ __i <=> __i } -> same_as<strong_ordering>;
}
{
return __x.base() <=> __y.base();
}

template <class _Iter1, class _Iter2>
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept {
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept
requires requires(const _Iter1& __lhs, const _Iter2& __rhs) {
{ __lhs <=> __rhs } -> same_as<strong_ordering>;
}
{
return __x.base() <=> __y.base();
}

#endif // _LIBCPP_STD_VER <= 17
#endif // _LIBCPP_STD_VER >= 20

template <class _Iter1, class _Iter2>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
Expand Down
14 changes: 10 additions & 4 deletions libcxx/include/deque
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ template <class T, class Allocator, class Predicate>
#include <__algorithm/remove_if.h>
#include <__algorithm/unwrap_iter.h>
#include <__assert>
#include <__concepts/same_as.h>
#include <__config>
#include <__debug_utils/sanitizers.h>
#include <__format/enable_insertable.h>
Expand Down Expand Up @@ -376,7 +377,6 @@ public:
return __x.__ptr_ == __y.__ptr_;
}

#if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI friend bool operator!=(const __deque_iterator& __x, const __deque_iterator& __y) {
return !(__x == __y);
}
Expand All @@ -396,8 +396,14 @@ public:
_LIBCPP_HIDE_FROM_ABI friend bool operator>=(const __deque_iterator& __x, const __deque_iterator& __y) {
return !(__x < __y);
}
#else // _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {

#if _LIBCPP_STD_VER >= 20
// template <class _Tp = void>
_LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y)
requires requires(const pointer& __i) {
{ __i <=> __i } -> same_as<strong_ordering>;
}
{
if (__x.__m_iter_ < __y.__m_iter_)
return strong_ordering::less;

Expand All @@ -406,7 +412,7 @@ public:

return strong_ordering::greater;
}
#endif // _LIBCPP_STD_VER <= 17
#endif // _LIBCPP_STD_VER >= 20

private:
_LIBCPP_HIDE_FROM_ABI explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT
Expand Down

0 comments on commit c4db2df

Please sign in to comment.