view gcc/testsuite/gcc.dg/pr64417.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR c/64417 */
/* { dg-do compile } */
/* { dg-options "" } */

struct foo { int x; char y[]; };
struct bar { struct foo f; };
struct baz { struct bar b; };

struct foo a1 = { 1, "abc" };
struct foo a2 = { 1, { "abc" } };
struct foo b1[] = { { 1, "abc" } }; /* { dg-error "initialization of flexible array member" } */
struct foo b2[] = { { 1, { "abc" } } }; /* { dg-error "initialization of flexible array member" } */
struct bar c1[] = { { { 1, "abc" } } }; /* { dg-error "initialization of flexible array member" } */
struct bar c2[] = { { { 1, { "abc" } } } }; /* { dg-error "initialization of flexible array member" } */
struct baz d1[] = { { { { 1, "abc" } } } }; /* { dg-error "initialization of flexible array member" } */
struct baz d2[] = { { { { 1, { "abc" } } } } }; /* { dg-error "initialization of flexible array member" } */