aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-stdarg-2.c
blob: 27782401c93dd2c8fa4ae36102f0d7f0c4e6992d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Test C2x variadic functions with no named parameters.  Compilation tests,
   valid code, verify not considered unprototyped functions.  */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors -Wstrict-prototypes -Wold-style-definition" } */

int f (...);
int g (int (...));
int h (...) { return 0; }

typedef int A[];
typedef int A2[2];

A *f1 (...);
A2 *f1 (...);
A *f1 (...) { return 0; }

A2 *f2 (...);
A *f2 (...);
A2 *f2 (...) { return 0; }
typeof (f1) f2;

int t () { return f () + f (1) + f (1, 2) + h () + h (1.5, 2, f1) + g (f); }