| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
|
| 3 |
// PR libstdc++/105609 |
| 4 |
// ranges::move should use ranges::iter_move instead of std::move |
| 5 |
|
| 6 |
#include <algorithm> |
| 7 |
|
| 8 |
namespace pr105609 |
| 9 |
{ |
| 10 |
struct I { |
| 11 |
using value_type = int; |
| 12 |
using difference_type = std::ptrdiff_t; |
| 13 |
int operator*() const; |
| 14 |
I& operator++(); |
| 15 |
I operator++(int); |
| 16 |
I& operator--(); |
| 17 |
I operator--(int); |
| 18 |
bool operator==(I) const; |
| 19 |
friend int& iter_move(const I&); |
| 20 |
}; |
| 21 |
} |
| 22 |
|
| 23 |
void |
| 24 |
test(pr105609::I i) |
| 25 |
{ |
| 26 |
struct O { |
| 27 |
O(int&) { } |
| 28 |
O(int&&) = delete; |
| 29 |
}; |
| 30 |
|
| 31 |
O* o = nullptr; |
| 32 |
std::ranges::move_backward(i, i, o); |
| 33 |
} |