gcc/testsuite/g++.dg/coroutines/pr102489.C
raw| 1 | // PR c++/102489 |
| 2 | // { dg-do compile } |
| 3 | // { dg-additional-options "-O" } |
| 4 | |
| 5 | #include <coroutine> |
| 6 | |
| 7 | struct footask { |
| 8 | struct promise_type { |
| 9 | std::suspend_never initial_suspend(); |
| 10 | std::suspend_never final_suspend() noexcept; |
| 11 | void unhandled_exception(); |
| 12 | footask get_return_object(); |
| 13 | }; |
| 14 | std::suspend_always foo; |
| 15 | footask taskfun() { co_await foo; } |
| 16 | }; |