https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93267
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Your testcase is invalid: iota.cc: In function 'int main()': iota.cc:22:6: error: conflicting declaration 'auto beginTest4' 22 | auto beginTest4 = std::ranges::begin(Test5); // OK | ^~~~~~~~~~ iota.cc:19:6: note: previous declaration as 'std::ranges::iota_view<long unsigned int, long unsigned int>::_Iterator beginTest4' 19 | auto beginTest4 = std::ranges::begin(Test4); // Error | ^~~~~~~~~~ It compiles for me if I fix that.