https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110635
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:4042cecd6245dc773fc150d5fd839968674e4500 commit r14-11728-g4042cecd6245dc773fc150d5fd839968674e4500 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Mon Aug 19 20:50:54 2024 +0100 c++, coroutines: Look through initial_await target exprs [PR110635]. In the case that the initial awaiter returns an object, the initial await can be a target expression and we need to look at its initializer to cast the await_resume() to void and to wrap in a compound expression that sets the initial_await_resume_called flag. PR c++/110635 gcc/cp/ChangeLog: * coroutines.cc (cp_coroutine_transform::wrap_original_function_body): Look through initial await target expressions to find the actual co_await_expr that we need to update. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr110635.C: New test. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> (cherry picked from commit c442a9b78bdbebdbcb4a8f91bc36961eb732fbdf)