]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-unproto-2.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-unproto-2.c
1 /* Test compatibility of unprototyped and prototyped function types (C2x makes
2 the case of types affected by default argument promotions compatible). Test
3 invalid-in-C2x usages. */
4 /* { dg-do compile } */
5 /* { dg-options "-std=c2x -pedantic-errors" } */
6
7 void f1 (); /* { dg-message "previous declaration" } */
8 void f1 (int, ...); /* { dg-error "conflicting types" } */
9 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
10
11 void f2 (int, ...); /* { dg-message "previous declaration" } */
12 void f2 (); /* { dg-error "conflicting types" } */
13 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
14
15 void f3 (); /* { dg-message "previous declaration" } */
16 void f3 (char, ...); /* { dg-error "conflicting types" } */
17 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */
18
19 void f4 (char, ...); /* { dg-message "previous declaration" } */
20 void f4 (); /* { dg-error "conflicting types" } */
21 /* { dg-message "ellipsis" "" { target *-*-* } .-1 } */