c++: fix the use of destructors when variants are enabled

When using variants, destructors generate invalid code.
<http://lists.gnu.org/archive/html/bug-bison/2014-09/msg00005.html>
Reported by Michael Catanzaro.

* data/c++.m4 (~basic_symbol): b4_symbol_foreach works on yysym:
define it.
* tests/c++.at (Variants): Check it.
This commit is contained in:
Akim Demaille
2015-01-09 12:01:22 +01:00
parent e1d06b5235
commit ee028dceff
4 changed files with 41 additions and 10 deletions

14
NEWS
View File

@@ -4,19 +4,23 @@ GNU Bison NEWS
** Bug fixes
*** Named %union support
*** C++ with Variants (lalr1.cc)
Problems with %destructor and '%define parse.assert' have been fixed.
*** Named %union support (yacc.c, glr.c)
Bison 3.0 introduced a regression on named %union such as
%union foo { int ival; };
The possibility to use a name was introduced ``for Yacc compatibility''.
The possibility to use a name was introduced "for Yacc compatibility".
It is however not required by POSIX Yacc, and its usefulness is not clear.
*** %define api.value.type union with %defines
*** %define api.value.type union with %defines (yacc.c, glr.c)
The yacc.c and glr.c parsers were broken when %defines was used
together with "%define api.value.type union".
The C parsers were broken when %defines was used together with "%define
api.value.type union".
*** Redeclarations are reported in proper order