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

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Diagnostics for attempts to access a member not in a structure or
kono
parents:
diff changeset
2 union should name the type involved. Bug 13804. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct s0 { int a; };
kono
parents:
diff changeset
8 union u0 { long b; };
kono
parents:
diff changeset
9 typedef struct s0 S0;
kono
parents:
diff changeset
10 typedef union u0 U0;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 struct s0 x0;
kono
parents:
diff changeset
13 S0 x1;
kono
parents:
diff changeset
14 union u0 x2;
kono
parents:
diff changeset
15 U0 x3;
kono
parents:
diff changeset
16 struct s0 *x4;
kono
parents:
diff changeset
17 union u0 *x5;
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 void
kono
parents:
diff changeset
20 f (void)
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 x0.c; /* { dg-error "'struct s0' has no member named 'c'" } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
23 x1.c; /* { dg-error "'S0' {aka 'struct s0'} has no member named 'c'" } */
111
kono
parents:
diff changeset
24 x2.c; /* { dg-error "'union u0' has no member named 'c'" } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
25 x3.c; /* { dg-error "'U0' {aka 'union u0'} has no member named 'c'" } */
111
kono
parents:
diff changeset
26 x4->c; /* { dg-error "'struct s0' has no member named 'c'" } */
kono
parents:
diff changeset
27 x5->c; /* { dg-error "'union u0' has no member named 'c'" } */
kono
parents:
diff changeset
28 }