gcc/testsuite/gcc.dg/lvalue-10.c
raw| 1 | /* Test handling of lvalues of incomplete types. Bugs 36941, 88647 |
| 2 | (invalid), 88827. */ |
| 3 | /* { dg-do compile } */ |
| 4 | /* { dg-options "-std=c11 -pedantic-errors" } */ |
| 5 | |
| 6 | struct S; |
| 7 | |
| 8 | extern struct S var; |
| 9 | extern struct S *vp; |
| 10 | |
| 11 | void |
| 12 | f8 (void) |
| 13 | { |
| 14 | /* These are valid because there is no constraint violation and the |
| 15 | result of '*' is never converted from an lvalue to an rvalue |
| 16 | (which would yield undefined behavior). */ |
| 17 | &var; |
| 18 | &*vp; |
| 19 | &(var); |
| 20 | &(*vp); |
| 21 | &*&*vp; |
| 22 | } |