aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-old-style-definition-6.c
blob: 454203487cfd5ea7dadfdb0a55f81e781b11470e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Test old-style function definitions not in C23: () gives a type with
   a prototype for all declarations.  */
/* { dg-do compile } */
/* { dg-options "-std=c23" } */

void f1 (); /* { dg-message "declared here" } */

/* Prototyped function returning a pointer to a function with no arguments.  */
void (*f2 (void))() { return f1; }

void
g (void)
{
  f1 (1); /* { dg-error "too many arguments" } */
  f2 () (1); /* { dg-error "too many arguments" } */
}