view gcc/testsuite/gcc.c-torture/compile/pr28865.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

struct var_len
{
  int field1;
  const char field2[];
};

/* Note - strictly speaking this array declaration is illegal
   since each element has a variable length.  We used to allow
   this because it was used in existing code.
   Since PR64417 we reject this code.  */
static const struct var_len var_array[] = 
{
  { 1, "Long exposure noise reduction" }, /* { dg-error "initialization of flexible array member" } */
  { 2, "Shutter/AE lock buttons" }, /* { dg-error "initialization of flexible array member" } */
  { 3, "Mirror lockup" } /* { dg-error "initialization of flexible array member" } */
};