| 1 |
// { dg-additional-options "-Wzero-as-null-pointer-constant -fsyntax-only" } |
| 2 |
|
| 3 |
#include <coroutine> |
| 4 |
|
| 5 |
struct task |
| 6 |
{ |
| 7 |
struct promise_type |
| 8 |
{ |
| 9 |
task get_return_object() { return {}; } |
| 10 |
std::suspend_never initial_suspend() { return {}; } |
| 11 |
std::suspend_never final_suspend() noexcept { return {}; } |
| 12 |
void return_void() {} |
| 13 |
void unhandled_exception() {} |
| 14 |
}; |
| 15 |
}; |
| 16 |
|
| 17 |
task resuming_on_new_thread(void) |
| 18 |
{ |
| 19 |
struct awaitable |
| 20 |
{ |
| 21 |
bool await_ready() { return false; } |
| 22 |
void await_suspend(std::coroutine_handle<> h) { } |
| 23 |
void await_resume() {} |
| 24 |
}; |
| 25 |
co_await awaitable{}; |
| 26 |
} |