PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / pr56724-2.c
blob4abb7d899e72fdc7f0e509a7cfcef7dec384aa62
1 /* PR c/56724 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wc++-compat -Wpedantic" } */
5 enum E1 { A };
6 enum E2 { B };
7 extern void foo_E (enum E1);
8 extern void foo_v (void *p);
9 extern void foo_sc (int, int, signed char *);
10 extern unsigned char *uc;
11 extern signed char sc;
12 extern const signed char *csc;
13 extern float *f;
15 void
16 foo (void)
18 void (*fp)(void);
19 const void (*ffp)(void);
20 foo_v (fp); /* { dg-warning "10:ISO C forbids passing argument" } */
21 foo_E (B); /* { dg-warning "10:enum conversion when passing argument" } */
22 foo_sc (1, 2, uc); /* { dg-warning "17:pointer targets in passing argument" } */
23 foo_sc (1, 2, f); /* { dg-warning "17:passing argument" } */
24 foo_sc (1, 2, sc); /* { dg-warning "17:passing argument" } */
25 foo_sc (uc, 2, &sc); /* { dg-warning "11:passing argument" } */
26 foo_sc (1, 2, csc); /* { dg-warning "17:passing argument" } */
29 typedef void (*fp)(void);
30 typedef void (*nrfp)(void) __attribute__((noreturn));
31 void f1 (nrfp); void f2 (fp x) { f1 (x); } extern int e; /* { dg-warning "38:passing argument" } */