Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / diag-aka-1.c
blob87bc75753e4f797bbaf6cd4dc099c4bc46743599
1 /* { dg-do compile } */
2 /* { dg-options "-Wc++-compat" } */
4 typedef struct A { int i; } B;
5 typedef struct T { int i; } T;
6 typedef const float TFA;
7 typedef TFA TFB;
8 typedef TFB TFC;
9 typedef int IA[];
10 typedef IA *IAP;
11 extern IAP arr[];
13 void fn1 (B *); /* { dg-message "expected .B \\* {aka struct A \\*}. but argument is of type .struct B \\*." } */
14 void fn2 (TFC *);
16 void
17 bar (B *b, int *i)
19 fn1 ((struct B *) b); /* { dg-warning "passing argument" } */
20 fn2 (i); /* { dg-warning "passing argument" } */
21 sizeof (arr); /* { dg-error "invalid application of .sizeof. to incomplete type .int \\(\\*\\\[\\\]\\)\\\[\\\]." } */
24 int
25 foo (void *a)
27 T *t = a; /* { dg-warning "request for implicit conversion from .void \\*. to .T \\* {aka struct T \\*}. not" } */
28 return t->i;