Index: gcc/testsuite/gcc.dg/struct-semi-4.c
===================================================================
--- gcc/testsuite/gcc.dg/struct-semi-4.c	(revision 0)
+++ gcc/testsuite/gcc.dg/struct-semi-4.c	(revision 0)
@@ -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; }
Index: gcc/c-parser.c
===================================================================
--- gcc/c-parser.c	(revision 166433)
+++ gcc/c-parser.c	(working copy)
@@ -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)
