This is a series of patches that addresses the majority of the open PRs related to the coroutine ramp function.
It is presented as a series because the actual bug fixes depend on some preparatory patches (which are also used to resolve issues with other PR fixes - e.g. Arsen's fix for PR109867). The series has been tested incrementally against the GCC testsuite, cppcoro and the folly coroutines tests. ----- Iain Sandoe (9): c++, coroutines: Split the ramp build into a separate function. c++, coroutines: Separate the analysis, ramp and outlined function synthesis. c++, coroutines: Separate allocator work from the ramp body build. c++, coroutines: Fix handling of early exceptions [PR113773]. c++, coroutines: Only allow void get_return_object if the ramp is void [PR100476]. c++, coroutines: Allow convertible get_return_on_allocation_fail [PR109682]. c++, coroutines: Fix ordering of return object conversions [PR115908]. c++, coroutines: Rework handling of throwing_cleanups [PR102051]. c++, coroutines: Look through initial_await target exprs [PR110635]. gcc/cp/coroutines.cc | 1391 ++++++++--------- gcc/cp/coroutines.h | 132 ++ gcc/cp/cp-tree.h | 1 - gcc/cp/decl.cc | 80 +- .../coro-bad-gro-00-class-gro-scalar-return.C | 4 +- .../coro-bad-gro-01-void-gro-non-class-coro.C | 4 +- .../coroutines/coro-bad-grooaf-00-static.C | 6 +- gcc/testsuite/g++.dg/coroutines/pr102051.C | 16 + gcc/testsuite/g++.dg/coroutines/pr102489.C | 2 +- gcc/testsuite/g++.dg/coroutines/pr103868.C | 2 +- gcc/testsuite/g++.dg/coroutines/pr109682.C | 28 + gcc/testsuite/g++.dg/coroutines/pr110635.C | 72 + gcc/testsuite/g++.dg/coroutines/pr115908.C | 75 + .../g++.dg/coroutines/pr94879-folly-1.C | 3 +- .../g++.dg/coroutines/pr94883-folly-2.C | 39 +- gcc/testsuite/g++.dg/coroutines/pr96749-2.C | 2 +- .../g++.dg/coroutines/ramp-return-b.C | 8 +- .../g++.dg/coroutines/torture/pr113773.C | 66 + 18 files changed, 1135 insertions(+), 796 deletions(-) create mode 100644 gcc/cp/coroutines.h create mode 100644 gcc/testsuite/g++.dg/coroutines/pr102051.C create mode 100644 gcc/testsuite/g++.dg/coroutines/pr109682.C create mode 100644 gcc/testsuite/g++.dg/coroutines/pr110635.C create mode 100644 gcc/testsuite/g++.dg/coroutines/pr115908.C create mode 100644 gcc/testsuite/g++.dg/coroutines/torture/pr113773.C -- 2.39.2 (Apple Git-143)