1 /* PR c/64918 */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
4
5 struct S { int m, n; };
6 union U { short s; long int l; };
7
8 void
foo(int i)9 foo (int i)
10 {
11 int a[] = {
12 [0] = ++i,
13 [1] = i,
14 [0] = 42 /* { dg-warning "initialized field with side-effects overwritten" } */
15 };
16 struct S s = {
17 .n = ++i,
18 .m = i,
19 .n = i /* { dg-warning "initialized field with side-effects overwritten" } */
20 };
21 union U u = {
22 .s = i--,
23 .l = 42 /* { dg-warning "initialized field with side-effects overwritten" } */
24 };
25 }
26