https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99215
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:d5b1bb0d197f9141a0f0e510f8d1b598c3df9552 commit r12-2229-gd5b1bb0d197f9141a0f0e510f8d1b598c3df9552 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Wed Jul 7 19:56:20 2021 +0100 coroutines: Factor code. Match original source location in helpers [NFC]. This is primarily a source code refactoring, the only change is to ensure that the outlined functions are marked to begin at the same line as the original. Otherwise, they get the default (which seems to be input_location, which corresponds to the closing brace at the point that this is done). Having the source location point to that confuses some debuggers. This is a contributory fix to: PR c++/99215 - coroutines: debugging with gdb Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> gcc/cp/ChangeLog: * coroutines.cc (build_actor_fn): Move common code to act_des_fn. (build_destroy_fn): Likewise. (act_des_fn): Build the void return here. Ensure that the source location matches the original function.