]>
Commit | Line | Data |
---|---|---|
0a4b219d JM |
1 | /* Test old-style function definitions not in C2x: () gives a type with |
2 | a prototype for all declarations. */ | |
017c6491 JM |
3 | /* { dg-do compile } */ |
4 | /* { dg-options "-std=c2x" } */ | |
5 | ||
0a4b219d | 6 | void f1 (); /* { dg-message "declared here" } */ |
017c6491 | 7 | |
0a4b219d | 8 | /* Prototyped function returning a pointer to a function with no arguments. */ |
017c6491 JM |
9 | void (*f2 (void))() { return f1; } |
10 | ||
11 | void | |
12 | g (void) | |
13 | { | |
0a4b219d JM |
14 | f1 (1); /* { dg-error "too many arguments" } */ |
15 | f2 () (1); /* { dg-error "too many arguments" } */ | |
017c6491 | 16 | } |