annotate gcc/testsuite/gcc.dg/diag-aka-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-Wc++-compat" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef struct A { int i; } B;
kono
parents:
diff changeset
5 typedef struct T { int i; } T;
kono
parents:
diff changeset
6 typedef const float TFA;
kono
parents:
diff changeset
7 typedef TFA TFB;
kono
parents:
diff changeset
8 typedef TFB TFC;
kono
parents:
diff changeset
9 typedef int IA[];
kono
parents:
diff changeset
10 typedef IA *IAP;
kono
parents:
diff changeset
11 extern IAP arr[];
kono
parents:
diff changeset
12
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
13 void fn1 (B *); /* { dg-message "expected 'B \\*' {aka 'struct A \\*'} but argument is of type 'struct B \\*'" } */
111
kono
parents:
diff changeset
14 void fn2 (TFC *);
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 void
kono
parents:
diff changeset
17 bar (B *b, int *i)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 fn1 ((struct B *) b); /* { dg-warning "passing argument" } */
kono
parents:
diff changeset
20 fn2 (i); /* { dg-warning "passing argument" } */
kono
parents:
diff changeset
21 sizeof (arr); /* { dg-error "invalid application of .sizeof. to incomplete type .int \\(\\*\\\[\\\]\\)\\\[\\\]." } */
kono
parents:
diff changeset
22 }
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 int
kono
parents:
diff changeset
25 foo (void *a)
kono
parents:
diff changeset
26 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
27 T *t = a; /* { dg-warning "request for implicit conversion from 'void \\*' to 'T \\*' {aka 'struct T \\*'} not" } */
111
kono
parents:
diff changeset
28 return t->i;
kono
parents:
diff changeset
29 }