Allow empty struct-declaration-lists in spite of the N843 standard

This commit is contained in:
Pierre Pronchery 2009-07-27 17:08:56 +00:00
parent 698c0fd397
commit 37ff9e4277

View File

@ -518,10 +518,14 @@ static int _struct_or_union_specifier(C99 * c99)
return ret;
}
ret |= scan(c99);
ret |= _parse_check_set(c99, c99set_struct_declaration_list,
"struct declaration list", _struct_declaration_list);
/* XXX the grammar says there's got to be one */
if(_parse_in_set(c99, c99set_struct_declaration_list))
{
ret |= _struct_declaration_list(c99);
/* XXX the grammar doesn't mention this? */
if(_parse_is_code(c99, C99_CODE_COMMA))
ret |= scan(c99);
}
ret |= _parse_check(c99, C99_CODE_OPERATOR_RBRACE);
ret |= code_context_set(c99->code, context);
return ret;