Debian Codegraph @

gcc/testsuite/g++.dg/coroutines/pr93458-4-bad-coro-handle.C

raw
1 // { dg-additional-options "-fsyntax-only -fexceptions -w" }
2
3 // Diagose missing coroutine handle class template.
4
5 namespace std {
6 // coroutine traits
7 template<typename _R, typename...> struct coroutine_traits {
8 using promise_type = typename _R::promise_type;
9 };
10
11 // name is present, but not a template.
12 struct coroutine_handle {
13 };
14 }
15
16 int
17 bad_coroutine (void)
18 {
19 co_yield 5; // { dg-error {coroutines require a handle class template; cannot find 'std::coroutine_handle'} }
20 co_return;
21 }