yacc.c: fix broken union when api.value.type=union and %defines are used

Reported by Rich Wilson.

* data/c.m4 (b4_symbol_type_register): Append to b4_union_members,
not b4_user_union_members.
The latter invokes the former, but it is the former which is reinitialized
to empty by b4_value_type_setup_union.
* tests/types.at: Check it.

This reveals another bug, this time in the case of glr.c parsers.

* data/glr.c: Generate the header file before the implementation file,
to be sure that the setup is run before what depends on it.
This commit is contained in:
Akim Demaille
2014-12-31 14:15:06 +01:00
parent a3c3c6f242
commit 8d4dc896cb
5 changed files with 70 additions and 23 deletions

5
NEWS
View File

@@ -4,6 +4,11 @@ GNU Bison NEWS
** Bug fixes
*** %define api.value.type union with %defines
The yacc.c and glr.c parsers were broken when %defines was used
together with "%define api.value.type union".
*** Redeclarations are reported in proper order
On