https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119073
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:f2a7f845698bfb7aaded9ffacd7046ae25a8b1fc commit r15-7819-gf2a7f845698bfb7aaded9ffacd7046ae25a8b1fc Author: Jason Merrill <ja...@redhat.com> Date: Tue Mar 4 16:36:47 2025 -0500 c++: C++23 range-for temps and ?: [PR119073] Here gimplification got confused because extend_temps_r messed up the types of the arms of a COND_EXPR. PR c++/119073 gcc/cp/ChangeLog: * call.cc (extend_temps_r): Preserve types of COND_EXPR arms. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/range-for39.C: New test.