]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/c2x-old-style-definition-6.c
c: C2x removal of unprototyped functions
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-old-style-definition-6.c
CommitLineData
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 6void f1 (); /* { dg-message "declared here" } */
017c6491 7
0a4b219d 8/* Prototyped function returning a pointer to a function with no arguments. */
017c6491
JM
9void (*f2 (void))() { return f1; }
10
11void
12g (void)
13{
0a4b219d
JM
14 f1 (1); /* { dg-error "too many arguments" } */
15 f2 () (1); /* { dg-error "too many arguments" } */
017c6491 16}