gcc/testsuite/g++.dg/coroutines/pr93458-2-bad-traits.C
raw| 1 | // { dg-additional-options "-fsyntax-only -fexceptions -w" } |
| 2 | |
| 3 | // Diagose bad traits traits : fake something faulty. |
| 4 | |
| 5 | namespace std { |
| 6 | // name is present, but not a template. |
| 7 | struct coroutine_traits { |
| 8 | }; |
| 9 | } |
| 10 | |
| 11 | int |
| 12 | bad_coroutine (void) |
| 13 | { |
| 14 | co_yield 5; // { dg-error {coroutines require a traits template; cannot find 'std::coroutine_traits'} } |
| 15 | co_return; |
| 16 | } |