111
|
1 /* { dg-options "-fdiagnostics-show-caret" } */
|
|
2
|
|
3 union u
|
|
4 {
|
|
5 int color;
|
|
6 int shape;
|
|
7 };
|
|
8
|
|
9 int test (union u *ptr)
|
|
10 {
|
|
11 return ptr->colour; /* { dg-error "did you mean .color.?" } */
|
|
12
|
|
13 /* Verify that we get an underline and a fixit hint. */
|
|
14 /* { dg-begin-multiline-output "" }
|
|
15 return ptr->colour;
|
|
16 ^~~~~~
|
|
17 color
|
|
18 { dg-end-multiline-output "" } */
|
|
19 }
|
|
20
|
|
21
|
|
22 /* Verify that we don't offer a fixit hint in the presence of
|
|
23 a macro. */
|
|
24 int test_macro (union u *ptr)
|
|
25 {
|
|
26 #define FIELD colour /* { dg-error "did you mean .color.?" } */
|
|
27 return ptr->FIELD;
|
|
28
|
|
29 /* { dg-begin-multiline-output "" }
|
|
30 #define FIELD colour
|
|
31 ^~~~~~
|
|
32 { dg-end-multiline-output "" } */
|
|
33
|
|
34 /* { dg-begin-multiline-output "" }
|
|
35 return ptr->FIELD;
|
|
36 ^~~~~
|
|
37 { dg-end-multiline-output "" } */
|
|
38
|
|
39 #undef FIELD
|
|
40 }
|