TREE_OPERAND (body_start, 0) = push_stmt_list ();
}
+ /* If the original function has a return value with a non-trivial DTOR
+ and the body contains a var with a DTOR that might throw, the decl is
+ marked "throwing_cleanup".
+ We do not [in the ramp, which is synthesised here], use any body var
+ types with DTORs that might throw.
+ The original body is transformed into the actor function which only
+ contains void returns, and is also wrapped in a try-catch block.
+ So (a) the 'throwing_cleanup' is not correct for the ramp and (b) we do
+ not need to transfer it to the actor which only contains void returns. */
+ cp_function_chain->throwing_cleanup = false;
+
/* Create the coro frame type, as far as it can be known at this stage.
1. Types we already know. */
--- /dev/null
+#include <coroutine>
+
+struct task {
+ struct promise_type {
+ auto initial_suspend() noexcept { return std::suspend_always{}; }
+ auto final_suspend() noexcept { return std::suspend_always{}; }
+ void return_void() {}
+ task get_return_object() { return task{}; }
+ void unhandled_exception() noexcept {}
+ };
+
+ ~task() noexcept {}
+
+ bool await_ready() const noexcept { return false; }
+ void await_suspend(std::coroutine_handle<>) noexcept {}
+ void await_resume() noexcept {}
+};
+
+struct Error {
+ Error() { };
+ ~Error() noexcept(false) {}
+};
+
+task g();
+
+task f() {
+ Error error;
+ co_await g();
+}