]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/diag-aka-1.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / diag-aka-1.c
CommitLineData
2d51fcef
MP
1/* { dg-do compile } */
2/* { dg-options "-Wc++-compat" } */
3
4typedef struct A { int i; } B;
55879815 5typedef struct T { int i; } *T; /* { dg-warning "using 'T' as both a typedef and a tag is invalid" } */
2d51fcef
MP
6typedef const float TFA;
7typedef TFA TFB;
8typedef TFB TFC;
9typedef int IA[];
10typedef IA *IAP;
11extern IAP arr[];
12
ce95abc4 13void fn1 (B *); /* { dg-message "expected 'B \\*' {aka 'struct A \\*'} but argument is of type 'struct B \\*'" } */
2d51fcef
MP
14void fn2 (TFC *);
15
16void
17bar (B *b, int *i)
18{
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 \\(\\*\\\[\\\]\\)\\\[\\\]." } */
22}
23
24int
25foo (void *a)
26{
55879815 27 T t = a; /* { dg-warning "request for implicit conversion from 'void \\*' to 'T' {aka 'struct T \\*'} not" } */
2d51fcef
MP
28 return t->i;
29}