https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100290
--- Comment #1 from Pascal HAVÉ <hpwxf at haveneer dot com> --- Created attachment 50688 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50688&action=edit Minimal reproducer with an assertion Minimal reproducer to show the abnormal behavior. The assertion assert(std::ranges::next(v.begin()) == v.end()); and fails and should be OK. Any range-based for loop on it will go to an infinite loop.