c++, coroutines: Allow convertible get_return_on_allocation_fail [PR109682].
We have been requiring the get_return_on_allocation_fail() call to have the
same type as the ramp. This is not intended by the standard, so relax that
to allow anything convertible to the ramp return.
PR c++/109682
gcc/cp/ChangeLog:
* coroutines.cc
(cp_coroutine_transform::build_ramp_function): Allow for cases where
get_return_on_allocation_fail has a type convertible to the ramp
return type.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr109682.C: New test.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
(cherry picked from commit
f4915e6c4cd42e7d6f397dc36fab507cc47dad05)