Skip to content

Commit 462924b

Browse files
committed
Addresses review comments.
1 parent ecd6887 commit 462924b

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

libcxx/include/__iterator/bounded_iter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ struct __bounded_iter {
211211
}
212212
#endif
213213

214+
// TODO(mordante) disable these overloads in the LLVM 20 release.
214215
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR friend bool
215216
operator<(__bounded_iter const& __x, __bounded_iter const& __y) _NOEXCEPT {
216217
return __x.__current_ < __y.__current_;

libcxx/include/__iterator/wrap_iter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
147147
}
148148
#endif
149149

150+
// TODO(mordante) disable these overloads in the LLVM 20 release.
150151
template <class _Iter1>
151152
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool
152153
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT {
@@ -184,7 +185,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
184185
}
185186

186187
#if _LIBCPP_STD_VER >= 20
187-
188+
# if 0
188189
template <class _Iter1>
189190
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
190191
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noexcept {
@@ -200,7 +201,7 @@ operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) noex
200201
return strong_ordering::greater;
201202
}
202203
}
203-
204+
# endif
204205
template <class _Iter1, class _Iter2>
205206
_LIBCPP_HIDE_FROM_ABI constexpr strong_ordering
206207
operator<=>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) noexcept {

libcxx/include/deque

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ public:
382382
}
383383
#endif
384384

385+
// TODO(mordante) disable these overloads in the LLVM 20 release.
385386
_LIBCPP_HIDE_FROM_ABI friend bool operator<(const __deque_iterator& __x, const __deque_iterator& __y) {
386387
return __x.__m_iter_ < __y.__m_iter_ || (__x.__m_iter_ == __y.__m_iter_ && __x.__ptr_ < __y.__ptr_);
387388
}
@@ -399,7 +400,6 @@ public:
399400
}
400401

401402
#if _LIBCPP_STD_VER >= 20
402-
// template <class _Tp = void>
403403
_LIBCPP_HIDE_FROM_ABI friend strong_ordering operator<=>(const __deque_iterator& __x, const __deque_iterator& __y) {
404404
if (__x.__m_iter_ < __y.__m_iter_)
405405
return strong_ordering::less;

libcxx/test/libcxx/iterators/bounded_iter/comparison.pass.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,9 @@ TEST_CONSTEXPR_CXX14 bool tests() {
6161
}
6262

6363
#if TEST_STD_VER >= 20
64-
if constexpr (requires(std::__bounded_iter<Iter> const iter) {
65-
{ iter <=> iter } -> std::same_as<std::strong_ordering>;
66-
}) {
67-
// P1614
68-
std::same_as<std::strong_ordering> decltype(auto) r1 = iter1 <=> iter2;
69-
assert(r1 == std::strong_ordering::less);
70-
}
64+
// P1614
65+
std::same_as<std::strong_ordering> decltype(auto) r1 = iter1 <=> iter2;
66+
assert(r1 == std::strong_ordering::less);
7167
#endif
7268

7369
return true;

libcxx/test/std/containers/views/views.span/span.iterators/iterator.pass.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
#include "test_macros.h"
2323

2424
template <class T>
25-
TEST_CONSTEXPR void test_type() {
26-
#
27-
25+
constexpr void test_type() {
2826
using C = std::span<T>;
2927
typename C::iterator ii1{}, ii2{};
3028
typename C::iterator ii4 = ii1;
3129
// TODO Test against C++23 after implementing
32-
// P2278R4 cbegin should always return a constant iterator
30+
// P2278R4 cbegin should always return a constant iterator
31+
// The means adjusting the #ifdef to guard against C++23.
3332
#ifdef __cpp_lib_ranges_as_const
3433
typename C::const_iterator cii{};
3534
#endif
@@ -77,7 +76,7 @@ TEST_CONSTEXPR void test_type() {
7776
#endif
7877
}
7978

80-
TEST_CONSTEXPR bool test() {
79+
constexpr bool test() {
8180
test_type<char>();
8281
test_type<int>();
8382
test_type<std::string>();

0 commit comments

Comments
 (0)