| 1 |
// { dg-additional-options "-fsyntax-only -w" } |
| 2 |
|
| 3 |
#include "coro.h" |
| 4 |
|
| 5 |
constexpr int bar () { |
| 6 |
co_yield 5; // { dg-error "cannot be used in a .constexpr. function" } |
| 7 |
return 42; /* Suppress the "no return" error. */ |
| 8 |
} |
| 9 |
|
| 10 |
int main () { |
| 11 |
return bar (); |
| 12 |
} |