Support empty structs in gengtype

gcc/
	* gengtype-parse.c (struct_field_seq): Support empty structs.

From-SVN: r204411
This commit is contained in:
David Malcolm 2013-11-05 18:55:22 +00:00 committed by David Malcolm
parent 4b632a0635
commit c180e49596
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2013-11-05 David Malcolm <dmalcolm@redhat.com>
* gengtype-parse.c (struct_field_seq): Support empty structs.
2013-11-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/t-rtems (MULTILIB_MATCHES): Fix option typos.

View File

@ -730,7 +730,7 @@ declarator (type_p ty, const char **namep, options_p *optsp,
(
type bitfield ';'
| type declarator bitfield? ( ',' declarator bitfield? )+ ';'
)+
)*
Knows that such declarations must end with a close brace (or,
erroneously, at EOF).
@ -744,7 +744,7 @@ struct_field_seq (void)
const char *name;
bool another;
do
while (token () != '}' && token () != EOF_TOKEN)
{
ty = type (&opts, true);
@ -787,7 +787,6 @@ struct_field_seq (void)
}
while (another);
}
while (token () != '}' && token () != EOF_TOKEN);
return nreverse_pairs (f);
}