| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-pedantic-errors" } */ |
| 3 |
|
| 4 |
void f1 (void); |
| 5 |
|
| 6 |
int |
| 7 |
f2 (void) |
| 8 |
{ |
| 9 |
f1 (); |
| 10 |
} |
| 11 |
|
| 12 |
static inline int |
| 13 |
f3 (void) |
| 14 |
{ |
| 15 |
f1 (); |
| 16 |
} |
| 17 |
|
| 18 |
void |
| 19 |
f4 (void) |
| 20 |
{ |
| 21 |
return 1; /* { dg-error "with a value,\[^\n\r\]*-Wreturn-mismatch" } */ |
| 22 |
} |
| 23 |
|
| 24 |
void |
| 25 |
f5 (void) |
| 26 |
{ |
| 27 |
return f1 (); /* { dg-error "with expression, in function\[^\n\r\]*-Wpedantic" } */ |
| 28 |
} |
| 29 |
|
| 30 |
int |
| 31 |
f6 (void) |
| 32 |
{ |
| 33 |
return; /* { dg-error "with no value,\[^\n\r\]*Wreturn-mismatch" } */ |
| 34 |
} |
| 35 |
|
| 36 |
int |
| 37 |
f7 (void) |
| 38 |
{ |
| 39 |
return f1 (); /* { dg-error "void value not ignored as it ought to be" } */ |
| 40 |
} |