* testsuite/libgomp.fortran/vla7.f90: Add -w to options.
[official-gcc.git] / gcc / testsuite / gcc.dg / c90-array-lval-5.c
blobc218a4dae679b20a1481dc62d1d5d220bdc66cd1
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:1990 -pedantic-errors" } */
8 struct s { char c[1]; };
10 extern struct s foo (void);
11 struct s a, b, c;
12 int d;
14 void
15 bar (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 }