c-parser.c (c_parser_struct_declaration): Handle declaration specifiers followed by CPP_CLOSE_BRACE.
* c-parser.c (c_parser_struct_declaration): Handle declaration specifiers followed by CPP_CLOSE_BRACE. testsuite: * gcc.dg/struct-semi-4.c: New test. From-SVN: r166516
This commit is contained in:
parent
7f904ad108
commit
b8cbdff525
4 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-11-09 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* c-parser.c (c_parser_struct_declaration): Handle declaration
|
||||
specifiers followed by CPP_CLOSE_BRACE.
|
||||
|
||||
2010-11-09 Michael Meissner <meissner@linux.vnet.ibm.com>
|
||||
|
||||
* config/rs6000/rs6000.md (floatsi<mode>2_lfiwax): Rewrite so
|
||||
|
|
|
@ -2395,7 +2395,8 @@ c_parser_struct_declaration (c_parser *parser)
|
|||
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)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2010-11-09 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* gcc.dg/struct-semi-4.c: New test.
|
||||
|
||||
2010-11-09 Michael Meissner <meissner@linux.vnet.ibm.com>
|
||||
|
||||
* gcc.target/powerpc/ppc-fpconv-11.c: Use -mcpu=power5+, not
|
||||
|
|
7
gcc/testsuite/gcc.dg/struct-semi-4.c
Normal file
7
gcc/testsuite/gcc.dg/struct-semi-4.c
Normal file
|
@ -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; }
|
Loading…
Add table
Reference in a new issue