view gcc/testsuite/gcc.dg/c99-flex-array-typedef-8.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "" } */

typedef char T[];
struct foo { int x; T 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" } */