gcc/testsuite/g++.dg/coroutines/coro-function-decl.C
raw| 1 | #include <coroutine> |
| 2 | |
| 3 | struct task |
| 4 | { |
| 5 | struct promise_type |
| 6 | { |
| 7 | std::suspend_always initial_suspend () { return {}; } |
| 8 | std::suspend_always final_suspend () noexcept { return {}; } |
| 9 | void unhandled_exception () {} |
| 10 | task get_return_object () noexcept { return {}; } |
| 11 | void return_void () {} |
| 12 | }; |
| 13 | }; |
| 14 | |
| 15 | task foo () |
| 16 | { |
| 17 | void bar (); |
| 18 | co_return; |
| 19 | } |