In warnings, say "previous declaration" rather than "first

declaration".
* src/symtab.c (redeclaration): Do that here.
* src/reader.c (record_merge_function_type): In the case of a result
type clash, report the previous declaration rather than the very first
one in the grammar file.
* tests/glr-regression.at (Missed %merge type warnings when LHS type is
declared later): Add a third declaration to check this behavior.
* tests/input.at (Incompatible Aliases): Update output.
This commit is contained in:
Joel E. Denny
2006-07-07 21:25:03 +00:00
parent fab044e6da
commit dd60572a8b
5 changed files with 29 additions and 15 deletions

View File

@@ -193,13 +193,13 @@ exp: foo;
AT_CHECK([bison input.y], [1], [],
[[input.y:8.7-11: %type redeclaration for foo
input.y:3.7-11: first declaration
input.y:3.7-11: previous declaration
input.y:10.13-17: %destructor redeclaration for foo
input.y:5.13-17: first declaration
input.y:5.13-17: previous declaration
input.y:9.10-14: %printer redeclaration for foo
input.y:4.10-14: first declaration
input.y:4.10-14: previous declaration
input.y:11.1-5: %left redeclaration for foo
input.y:6.1-5: first declaration
input.y:6.1-5: previous declaration
]])
AT_CLEANUP