Debian Codegraph @

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

raw
1 // https://gcc.gnu.org/PR105475
2 namespace std {
3
4 struct handle {};
5
6 struct awaitable {
7 bool await_ready() noexcept { return false; }
8 void await_suspend(handle) noexcept {}
9 bool await_resume() noexcept { return true; }
10 };
11
12 template <typename T> struct coroutine_handle {
13 static handle from_address(void *address) noexcept { return {}; }
14 };
15
16 template <typename T = void> struct coroutine_traits {
17 struct promise_type {
18 awaitable initial_suspend() { return {}; }
19 awaitable final_suspend() noexcept { return {}; }
20 void return_void() {}
21 T get_return_object() { return T(); }
22 void unhandled_exception() {}
23 };
24 };
25 } // namespace std
26
27 void foo() { co_return; }
28 // { dg-error "'address' is not a member of 'std::coroutine_handle<void>'" "" { target *-*-* } {.-1} }