@@ -7880,7 +7880,8 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
else if (!saw_named_field)
{
error_at (DECL_SOURCE_LOCATION (x),
- "flexible array member in otherwise empty struct");
+ "flexible array member in a struct with no named "
+ "members");
TREE_TYPE (x) = error_mark_node;
}
}
@@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-std=c89 -pedantic" } */
struct { int a[]; } x = { 0 }; /* { dg-warning "ISO C90 does not support flexible array members" } */
-/* { dg-error "flexible array member in otherwise empty struct" "" { target *-*-* } 3 } */
+/* { dg-error "flexible array member in a struct with no named members" "" { target *-*-* } 3 } */
@@ -2,7 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
-struct s1 { int x[]; }; /* { dg-error "empty struct" "empty" } */
-struct s2 { int :1; int x[]; }; /* { dg-error "empty struct" "empty" } */
+struct s1 { int x[]; }; /* { dg-error "no named members" "members" } */
+struct s2 { int :1; int x[]; }; /* { dg-error "no named members" "members" } */
struct s3 { int x[]; int y; }; /* { dg-error "not at end" "not at end" } */
struct s4 { int x; int y[]; };
@@ -3,7 +3,7 @@
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
typedef int A[];
-struct s1 { A x; }; /* { dg-error "empty struct" "empty" } */
-struct s2 { int :1; A x; }; /* { dg-error "empty struct" "empty" } */
+struct s1 { A x; }; /* { dg-error "no named members" "members" } */
+struct s2 { int :1; A x; }; /* { dg-error "no named members" "members" } */
struct s3 { A x; int y; }; /* { dg-error "not at end" "not at end" } */
struct s4 { int x; A y; };