Generate an error on empty declaration lists

This causes an error for code such as 'float;'
This commit is contained in:
Ian Romanick
2010-06-07 18:49:48 -07:00
parent 603b8fc4b2
commit 6cd2a5cc4b
+7 -2
View File
@@ -779,8 +779,13 @@ init_declarator_list:
single_declaration:
fully_specified_type
{
$$ = new ast_declarator_list($1);
$$->set_location(yylloc);
if ($1->specifier->type_specifier != ast_struct) {
_mesa_glsl_error(& @1, state, "empty declaration list\n");
YYERROR;
} else {
$$ = new ast_declarator_list($1);
$$->set_location(yylloc);
}
}
| fully_specified_type IDENTIFIER
{