Skip to content

Commit c4db2df

Browse files
committed
Test for CI fixes.
This should fix the CI, however when this works more tests should be added to avoid regression.
1 parent cd9e497 commit c4db2df

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

libcxx/include/__iterator/wrap_iter.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define _LIBCPP___ITERATOR_WRAP_ITER_H
1212

1313
#include <__compare/ordering.h>
14+
#include <__concepts/same_as.h>
1415
#include <__config>
1516
#include <__iterator/iterator_traits.h>
1617
#include <__memory/addressof.h>
@@ -120,8 +121,6 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
120121
return __x.base() == __y.base();
121122
}
122123

123-
#if _LIBCPP_STD_VER <= 17
124-
125124
template <class _Iter1>
126125
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
127126
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
@@ -182,21 +181,29 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
182181
return !(__y < __x);
183182
}
184183

185-
#else // _LIBCPP_STD_VER <= 17
184+
#if _LIBCPP_STD_VER >= 20
186185

187186
template <class _Iter1>
188187
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
189-
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept {
188+
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept
189+
requires requires(const _Iter1& __i) {
190+
{ __i <=> __i } -> same_as<strong_ordering>;
191+
}
192+
{
190193
return __x.base() <=> __y.base();
191194
}
192195

193196
template <class _Iter1, class _Iter2>
194197
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
195-
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept {
198+
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept
199+
requires requires(const _Iter1& __lhs, const _Iter2& __rhs) {
200+
{ __lhs <=> __rhs } -> same_as<strong_ordering>;
201+
}
202+
{
196203
return __x.base() <=> __y.base();
197204
}
198205

199-
#endif // _LIBCPP_STD_VER <= 17
206+
#endif // _LIBCPP_STD_VER >= 20
200207

201208
template <class _Iter1, class _Iter2>
202209
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14

libcxx/include/deque

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ template <class T, class Allocator, class Predicate>
189189
#include <__algorithm/remove_if.h>
190190
#include <__algorithm/unwrap_iter.h>
191191
#include <__assert>
192+
#include <__concepts/same_as.h>
192193
#include <__config>
193194
#include <__debug_utils/sanitizers.h>
194195
#include <__format/enable_insertable.h>
@@ -376,7 +377,6 @@ public:
376377
return __x.__ptr_ == __y.__ptr_;
377378
}
378379

379-
#if _LIBCPP_STD_VER <= 17
380380
_LIBCPP_HIDE_FROM_ABI friend bool operator!=(const __deque_iterator& __x, const __deque_iterator& __y) {
381381
return !(__x == __y);
382382
}
@@ -396,8 +396,14 @@ public:
396396
_LIBCPP_HIDE_FROM_ABI friend bool operator>=(const __deque_iterator& __x, const __deque_iterator& __y) {
397397
return !(__x < __y);
398398
}
399-
#else // _LIBCPP_STD_VER <= 17
400-
_LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
399+
400+
#if _LIBCPP_STD_VER >= 20
401+
// template <class _Tp = void>
402+
_LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y)
403+
requires requires(const pointer& __i) {
404+
{ __i <=> __i } -> same_as<strong_ordering>;
405+
}
406+
{
401407
if (__x.__m_iter_ < __y.__m_iter_)
402408
return strong_ordering::less;
403409

@@ -406,7 +412,7 @@ public:
406412

407413
return strong_ordering::greater;
408414
}
409-
#endif // _LIBCPP_STD_VER <= 17
415+
#endif // _LIBCPP_STD_VER >= 20
410416

411417
private:
412418
_LIBCPP_HIDE_FROM_ABI explicit __deque_iterator(__map_iterator __m, pointer __p) _NOEXCEPT

0 commit comments

Comments
 (0)