https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119073
--- Comment #3 from Philipp Fent <philipp at fent dot de> --- Thanks for mentioning it Andrew, this indeed seems to be related to a behavioral change in range-for lifetimes in C++23. I found commit 650e915 from Jakub Jelinek that implements the new behavior. There's also the -fno-range-for-ext-temps flag that switches back to the old behavior where the ICE does not happen. So the following causes the ICE: g++ crash.cpp -std=c++23 Those are ok though: g++ crash.cpp -std=c++20 g++ crash.cpp -std=c++23 -fno-range-for-ext-temps