mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -346,6 +346,7 @@ m4_define([b4_public_types_define],
|
||||
{]b4_variant_if([[
|
||||
// User destructor.
|
||||
symbol_number_type yytype = this->type_get ();
|
||||
basic_symbol<Base>& yysym = *this;
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
|
||||
Reference in New Issue
Block a user