gcc/testsuite/g++.dg/coroutines/co-await-initlist1.C
raw| 1 | // PR c++/103871 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | #include <coroutine> |
| 5 | #include <initializer_list> |
| 6 | |
| 7 | struct my_coro { |
| 8 | struct promise_type { |
| 9 | my_coro get_return_object(); |
| 10 | std::suspend_never initial_suspend(); |
| 11 | std::suspend_never final_suspend() noexcept; |
| 12 | void unhandled_exception(); |
| 13 | }; |
| 14 | }; |
| 15 | |
| 16 | std::suspend_never inner(std::initializer_list<int>); |
| 17 | |
| 18 | my_coro doesnt_work() |
| 19 | { |
| 20 | co_await inner({ 1,2,3 }); |
| 21 | } |