https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106612
Bug ID: 106612
Summary: ranges::iter_move does not consider iterator's value
categories
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
The following case should be a constraint not satisfied rather than a hard
error since we cannot dereference the I of an rvalue.
#include <ranges>
struct I {
using difference_type = std::ptrdiff_t;
using value_type = int;
value_type& operator*() const &;
void operator*() && = delete;
I& operator++();
I operator++(int);
bool operator==(const I&) const;
};
int main() {
return std::ranges::iter_move(I{});
}
https://godbolt.org/z/xP4GWT3qv