summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/lvalue-10.c
blob: cc5f37ba9648e124677347e48c3d9bd5d80f9e20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Test handling of lvalues of incomplete types.  Bugs 36941, 88647
   (invalid), 88827.  */
/* { dg-do compile } */
/* { dg-options "-std=c11 -pedantic-errors" } */

struct S;

extern struct S var;
extern struct S *vp;

void
f8 (void)
{
  /* These are valid because there is no constraint violation and the
     result of '*' is never converted from an lvalue to an rvalue
     (which would yield undefined behavior).  */
  &var;
  &*vp;
  &(var);
  &(*vp);
  &*&*vp;
}