Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/pr95822.C

raw
1 #include <coroutine>
2
3 struct task {
4 struct promise_type {
5 auto initial_suspend() noexcept { return std::suspend_always{}; }
6 auto final_suspend() noexcept { return std::suspend_always{}; }
7 void return_void() {}
8 task get_return_object() { return task{}; }
9 void unhandled_exception() noexcept {}
10 };
11
12 ~task() noexcept {}
13
14 bool await_ready() const noexcept { return false; }
15 void await_suspend(std::coroutine_handle<>) noexcept {}
16 void await_resume() noexcept {}
17 };
18
19 struct Error {
20 Error() { };
21 ~Error() noexcept(false) {}
22 };
23
24 task g();
25
26 task f() {
27 Error error;
28 co_await g();
29 }