https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93711

--- Comment #7 from Boris Staletic <boris.staletic at gmail dot com> ---
I don't know if this is the same problem, since the actual
`std::istream_iterator<int>` isn't empty, unlike in the other test cases. If
the following is a different problem, sorry up front for the noise.

https://godbolt.org/z/XAM9o7

This is the actual thing I've come across during a pull request for NanoRange
library.

DIfferences from the above test cases:

- ICE is there even at `-Og`, as well as `-O0`
- The bottom example shows that wrapping the call to `fn()` in `std::move()`
avoids the ICE.

If this is a separate issue and thus noise, I'll open a separate issue.

Reply via email to