Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/pr109283.C

raw
1 // PR 109283.
2 // This used to ICE from a check set too widely.
3 #include <coroutine>
4
5 struct foo
6 { ~foo(); };
7
8 struct task
9 {
10 struct promise_type
11 {
12 std::suspend_never initial_suspend();
13 std::suspend_never final_suspend() noexcept;
14 std::suspend_never yield_value(foo);
15 void return_void();
16 void unhandled_exception();
17 task get_return_object();
18 };
19 };
20
21 task source(int b) {
22 co_yield b ? foo{} : foo{};
23 }