gcc/testsuite/gcc.dg/c23-unproto-3.c
raw| 1 | /* Test that declaring a function with () is the same as (void) in C23. Valid |
| 2 | use cases. */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-std=c23 -pedantic-errors -Wstrict-prototypes" } */ |
| 5 | |
| 6 | void f1 (); |
| 7 | void f1 (void); |
| 8 | |
| 9 | void f2 (void); |
| 10 | void f2 (); |
| 11 | |
| 12 | typedef void T1 (); |
| 13 | typedef void T1 (void); |
| 14 | |
| 15 | void f3 (); |
| 16 | |
| 17 | _Static_assert (_Generic (f3, |
| 18 | void (*) (int) : 1, |
| 19 | void (*) (void) : 2, |
| 20 | default : 3) == 2); |