https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120273
--- Comment #12 from GCC 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:3b95be7bd1882add4b1e22f6b70bc130cd465eca commit r16-1534-g3b95be7bd1882add4b1e22f6b70bc130cd465eca Author: Iain Sandoe <i...@sandoe.co.uk> Date: Tue Jun 3 13:07:27 2025 +0100 c++, coroutines: Avoid UNKNOWN_LOCATION synthesizing code [PR120273]. Some of the lookup code is expecting to find a valid (not UNKNOWN) location, which triggers in the reported case. To avoid this, we are reverting the change to use UNKNOWN_LOCATION for synthesizing the wrapper, and instead using the start and end locations of the original function. PR c++/120273 gcc/cp/ChangeLog: * coroutines.cc (cp_coroutine_transform::wrap_original_function_body): Use function start and end locations when synthesizing code. (cp_coroutine_transform::cp_coroutine_transform): Set the function end location. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr120273.C: New test. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk>