1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-show-caret -std=c99" } */
4 /* Tests of incorrect name initializers.
5 Verify that we get underlines and, where appropriate, fixit hints. */
19 /* Old-style named initializers. */
21 struct foo old_style_f
= {
22 foa
: 1, /* { dg-error ".struct foo. has no member named .foa.; did you mean .foo." } */
23 /* { dg-begin-multiline-output "" }
27 { dg-end-multiline-output "" } */
29 this_does_not_match
: 3 /* { dg-error ".struct foo. has no member named .this_does_not_match." } */
31 /* { dg-begin-multiline-output "" }
32 this_does_not_match: 3
34 { dg-end-multiline-output "" } */
37 union u old_style_u
= { colour
: 3 }; /* { dg-error ".union u. has no member named .colour.; did you mean .color.?" } */
38 /* { dg-begin-multiline-output "" }
39 union u old_style_u = { colour: 3 };
42 { dg-end-multiline-output "" } */
44 /* C99-style named initializers. */
46 struct foo c99_style_f
= {
47 .foa
= 1, /* { dg-error ".struct foo. has no member named .foa.; did you mean .foo." } */
48 /* { dg-begin-multiline-output "" }
52 { dg-end-multiline-output "" } */
54 .this_does_not_match
= 3 /* { dg-error ".struct foo. has no member named .this_does_not_match." } */
55 /* { dg-begin-multiline-output "" }
56 .this_does_not_match = 3
58 { dg-end-multiline-output "" } */
61 union u c99_style_u
= { .colour
=3 }; /* { dg-error ".union u. has no member named .colour.; did you mean .color.?" } */
62 /* { dg-begin-multiline-output "" }
63 union u c99_style_u = { .colour=3 };
66 { dg-end-multiline-output "" } */