mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-10-28 18:35:42 +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:
1 parent
e1d06b5235
commit
ee028dceff
4 files changed
+41
-10
No files matched your search
@@ -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