aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wmissing-field-initializers-5.c
blob: 7cf5df1776420fe6d6ee016a1de7bbf0e7e0e472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR c/82283 */
/* { dg-do compile } */
/* { dg-options "-Wmissing-field-initializers" } */

struct foo {
        const char *a1;
        const char * const *a2;
        void *a3;
        void *a4;
};

const char *aux[] = { "y", 0 };

struct foo a = {
  .a1 = "x",
  .a2 = (const char * const []){ "y", 0 },
}; /* { dg-bogus "missing initializer" } */

struct foo b = {
  .a2 = (const char * const []){ "y", 0 },
  .a1 = "x",
};