mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 12:53:03 +00:00
tests: check token redeclaration
* src/symtab.c (symbol_class_set): Report previous definitions when redeclared. * tests/input.at (Symbol redeclared): New.
This commit is contained in:
@@ -462,7 +462,13 @@ symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
|
||||
if (declaring)
|
||||
{
|
||||
if (s->status == declared)
|
||||
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
||||
{
|
||||
unsigned i = 0;
|
||||
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
||||
i += SUB_INDENT;
|
||||
complain_indent (&sym->location, Wother, &i,
|
||||
_("previous declaration"));
|
||||
}
|
||||
else
|
||||
s->status = declared;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user