1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-show-caret" } */
7 /* Verify that we issue a hint for "." used with a ptr to a struct. */
9 int test_1 (struct foo
*ptr
)
11 return ptr
.x
; /* { dg-error "'ptr' is a pointer; did you mean to use '->'?" } */
12 /* { dg-begin-multiline-output "" }
16 { dg-end-multiline-output "" } */
19 /* Likewise for a ptr to a union. */
21 int test_2 (union u
*ptr
)
23 return ptr
.x
; /* { dg-error "'ptr' is a pointer; did you mean to use '->'?" } */
24 /* { dg-begin-multiline-output "" }
28 { dg-end-multiline-output "" } */
31 /* Verify that we don't issue a hint for a ptr to something that isn't a
34 int test_3 (void **ptr
)
36 return ptr
.x
; /* { dg-error "request for member 'x' in something not a structure or union" } */
37 /* { dg-begin-multiline-output "" }
40 { dg-end-multiline-output "" } */