| 1 |
// PR c++/116327 - ICE in coroutine with parameter preview on lambda with captures |
| 2 |
|
| 3 |
#include <coroutine> |
| 4 |
|
| 5 |
struct coroutine{ |
| 6 |
struct promise_type{ |
| 7 |
promise_type(const auto &...){} |
| 8 |
std::suspend_never initial_suspend(){ return {}; } |
| 9 |
std::suspend_always final_suspend()noexcept{ return {}; } |
| 10 |
void unhandled_exception(){} |
| 11 |
coroutine get_return_object(){ return {}; } |
| 12 |
void return_value(int)noexcept{} |
| 13 |
}; |
| 14 |
}; |
| 15 |
|
| 16 |
int main(){ |
| 17 |
auto f = [a=0](auto) -> coroutine { |
| 18 |
co_return 2; |
| 19 |
}; |
| 20 |
f(0); |
| 21 |
return 0; |
| 22 |
} |