Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/pr116793-1.C

raw
1 // https://gcc.gnu.org/PR116793
2 #include <tuple>
3 #include <coroutine>
4 struct _cleanup_task {
5 bool await_ready() const noexcept;
6 template <typename Promise>
7 bool await_suspend(std::coroutine_handle<Promise> parent) noexcept;
8 std::tuple<int &> await_resume() noexcept;
9 };
10 struct _task1 {
11 struct promise_type final {
12 std::suspend_always initial_suspend() noexcept;
13 _task1 get_return_object() noexcept;
14 void unhandled_exception() noexcept;
15 struct awaiter final {
16 bool await_ready() noexcept;
17 void await_resume() noexcept;
18 void await_suspend(std::coroutine_handle<promise_type> h) noexcept;
19 };
20 awaiter final_suspend() noexcept;
21 };
22 };
23 _cleanup_task func(int &&);
24 _task1 g() {
25 auto &&[i] = co_await func(3);
26 }