1 /* Test for non-lvalue arrays: test that the unary '&' operator is not
2 allowed on them, for both C90 and C99. */
4 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
8 struct s
{ char c
[1]; };
10 extern struct s
foo (void);
17 &((foo ()).c
); /* { dg-bogus "warning" "warning in place of error" } */
18 &((d
? b
: c
).c
); /* { dg-bogus "warning" "warning in place of error" } */
19 &((d
, b
).c
); /* { dg-bogus "warning" "warning in place of error" } */
20 &((a
= b
).c
); /* { dg-bogus "warning" "warning in place of error" } */
22 /* { dg-error "lvalue" "bad address-of" { target *-*-* } 17 }
23 { dg-error "lvalue" "bad address-of" { target *-*-* } 18 }
24 { dg-error "lvalue" "bad address-of" { target *-*-* } 19 }
25 { dg-error "lvalue" "bad address-of" { target *-*-* } 20 }