| 1 |
// PR c++/121643 |
| 2 |
|
| 3 |
#include <coroutine> |
| 4 |
|
| 5 |
struct Detached { |
| 6 |
struct promise_type { |
| 7 |
Detached get_return_object() const noexcept { return {}; } |
| 8 |
std::suspend_never initial_suspend() const noexcept { return {}; } |
| 9 |
void return_void() const noexcept {} |
| 10 |
void unhandled_exception() const noexcept { } |
| 11 |
std::suspend_never final_suspend() const noexcept { return {}; } |
| 12 |
}; |
| 13 |
}; |
| 14 |
|
| 15 |
struct Awaiter { |
| 16 |
bool await_ready() noexcept { return true; } |
| 17 |
void |
| 18 |
await_suspend(std::coroutine_handle<> h, |
| 19 |
int sloc = 1) |
| 20 |
noexcept |
| 21 |
{} |
| 22 |
void await_resume() noexcept {} |
| 23 |
}; |
| 24 |
|
| 25 |
Detached |
| 26 |
coroutine() |
| 27 |
{ |
| 28 |
co_await Awaiter{}; |
| 29 |
} |