The bison version I was using before (2.4.1) did not explicitly write the default action for every semantic rule which used it -- but probably simply assigned $$ with $1 once without regard to any types for all default action rules.
bison 3.5.1 insists on dumping this out by himself -- assuming that the stack is made up of a C style union.
Is there any way to convince bison 3.5.1 to follow the old style?
My workaround is to explicit write the default semantic action everywhere it is being used.
I'm already went over several bison changes in the past -- which can be glimpsed from many commented out parser instructions.
The only parser instruction I've left is
%skeleton "lalr1.cc"
%define namespace "smc"
%define parser_class_name "smc_parser"
%lex-param {location *const, symphony::smc::parserDriver& driver }
%parse-param { symphony::smc::parserDriver& driver }
%locations
Explanation of my approach: I'm using this already since many years in different projects. bison wants to convert the type into a member access. I expanded this into set/get methods. With YYSTYPE deriving from std::variant. So assume that a certain rule yields TYPE, then bison converts $$ automatically into $$.TYPE. The code written inside any rule then would look like this:
$$($1());
which results in
$$.TYPE($1.TYPE());
TYPE(argument) is a set method. TYPE(void) is a get method. These methods simply access the underlying std::variant.
Bison now creates the default implementation as
$$.TYPE = $1.TYPE;
which does not compile. It used to simply dump out one copy of $$=$1; for all actions (and all types) needing a default implementation -- means without any specific member.
$$ = $1;
? – rici