===================================================================
@@ -0,0 +1,7 @@
+/* Test for missing semicolons in structures: anonymous structures and
+ similar cases. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s { struct { int a; } }; /* { dg-warning "no semicolon" } */
+int *f (struct s *p) { return &p->a; }
===================================================================
@@ -2395,7 +2395,8 @@ c_parser_struct_declaration (c_parser *p
return NULL_TREE;
}
finish_declspecs (specs);
- if (c_parser_next_token_is (parser, CPP_SEMICOLON))
+ if (c_parser_next_token_is (parser, CPP_SEMICOLON)
+ || c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
tree ret;
if (!specs->type_seen_p)