https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118413
Bug ID: 118413
Summary: Move only function makes `std::views::transform` not
working correctly
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: zwuis at outlook dot com
Target Milestone: ---
```cpp
struct move_only_fn {
move_only_fn() = default;
move_only_fn(const move_only_fn&) = delete;
move_only_fn(move_only_fn&&) = default;
int operator()(int);
};
void test1() {
void(transform(iota(0, 1), move_only_fn{}));
} // This works expectedly
void test2() {
void(iota(0, 1) | transform(move_only_fn{}));
} // Compilation failed
```
Compiler Explorer: <https://godbolt.org/z/bzxz49xoq>