https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100476
--- Comment #11 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:98364636c194398d5dccb477e5405cb1d02a55f1 commit r14-11725-g98364636c194398d5dccb477e5405cb1d02a55f1 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Sat Aug 17 15:47:58 2024 +0100 c++, coroutines: Only allow void get_return_object if the ramp is void [PR100476]. Require that the value returned by get_return_object is convertible to the ramp return. This means that the only time we allow a void get_return_object, is when the ramp is also a void function. We diagnose this early to allow us to exit the ramp build if the return values are incompatible. PR c++/100476 gcc/cp/ChangeLog: * coroutines.cc (cp_coroutine_transform::build_ramp_function): Remove special handling of void get_return_object expressions. gcc/testsuite/ChangeLog: * g++.dg/coroutines/coro-bad-gro-01-void-gro-non-class-coro.C: Adjust expected diagnostic. * g++.dg/coroutines/pr102489.C: Avoid void get_return_object. * g++.dg/coroutines/pr103868.C: Likewise. * g++.dg/coroutines/pr94879-folly-1.C: Likewise. * g++.dg/coroutines/pr94883-folly-2.C: Likewise. * g++.dg/coroutines/pr96749-2.C: Likewise. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> (cherry picked from commit a0b431033c307982123abbff752045cfe7eda47f)