Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/torture/pr109867.C

raw
1 // https://gcc.gnu.org/PR109867
2 // { dg-additional-options "-Werror=switch-default" }
3 #include <coroutine>
4
5 struct task
6 {
7 struct promise_type
8 {
9 std::suspend_always initial_suspend();
10 std::suspend_always final_suspend() noexcept;
11 void unhandled_exception();
12 task get_return_object();
13 void return_value(int);
14 };
15 };
16
17 int main()
18 {
19 __attribute__((__unused__)) auto t = []() -> task
20 {
21 co_return 2;
22 }();
23 }