]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c11-unproto-2.c
testsuite: Refer more consistently to C23 not C2X
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c11-unproto-2.c
1 /* Test compatibility of unprototyped and prototyped function types (C23 made
2 the case of types affected by default argument promotions compatible, before
3 removing unprototyped functions completely). Test always-invalid-in-C23
4 usages, in C11 mode. */
5 /* { dg-do compile } */
6 /* { dg-options "-std=c11 -pedantic-errors" } */
7
8 void f1 (); /* { dg-message "previous declaration" } */
9 void f1 (int, ...); /* { dg-error "conflicting types" } */
10 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
11
12 void f2 (int, ...); /* { dg-message "previous declaration" } */
13 void f2 (); /* { dg-error "conflicting types" } */
14 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
15
16 void f3 (); /* { dg-message "previous declaration" } */
17 void f3 (char, ...); /* { dg-error "conflicting types" } */
18 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
19
20 void f4 (char, ...); /* { dg-message "previous declaration" } */
21 void f4 (); /* { dg-error "conflicting types" } */
22 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */