[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / bad-dereference.c
blob5f8188dbccd8a191d774c37060d1a132765fa25c
1 /* { dg-options "-fdiagnostics-show-caret" } */
3 struct foo
5 int x;
6 };
8 int test_1 (struct foo some_f)
10 return *some_f.x; /* { dg-error "invalid type argument of unary ... .have .int.." } */
11 /* { dg-begin-multiline-output "" }
12 return *some_f.x;
13 ^~~~~~~~~
14 { dg-end-multiline-output "" } */
17 int test_2 (struct foo some_f)
19 return *some_f; /* { dg-error "invalid type argument of unary ... .have .struct foo.." } */
20 /* { dg-begin-multiline-output "" }
21 return *some_f;
22 ^~~~~~~
23 { dg-end-multiline-output "" } */