https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118470
--- Comment #4 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:ec716ad3f4bdccb6a2780161e74e3168efa68121 commit r15-7337-gec716ad3f4bdccb6a2780161e74e3168efa68121 Author: Jason Merrill <ja...@redhat.com> Date: Fri Jan 31 12:31:43 2025 -0500 c++: coroutines and range for [PR118491] The implementation of extended range-for temporaries in r15-3840 confused coroutines, because await_statement_walker and the like get confused by the EXPR_STMT into thinking that the whole for-loop is a single expression statement and try to process it accordingly. Fixing this seems to be a simple matter of dropping the EXPR_STMT. PR c++/116914 PR c++/117231 PR c++/118470 PR c++/118491 gcc/cp/ChangeLog: * semantics.cc (finish_for_stmt): Don't wrap the result of pop_stmt_list in EXPR_STMT. gcc/testsuite/ChangeLog: * g++.dg/coroutines/coro-range-for1.C: New test.