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 <iain@sandoe.co.uk>
(cherry picked from commit
3b95be7bd1882add4b1e22f6b70bc130cd465eca)