Closed matz closed 2 weeks ago
Unfortunately
static const YYSTYPE yyval_default = YY_INITIAL_VALUE(YYSTYPE());
causes compilation error when #define YY_INITIAL_VALUE(Value) /* Nothing. */
error: expected primary-expression before ‘;’ token
6396 | static const YYSTYPE yyval_default = YY_INITIAL_VALUE(YYSTYPE());
| ^
In the generated C file, we see
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
, butclang
raises errorerror: default initialization of an object of const type
. According to the C++ language specification, we need a user provided default constructor for this kind of declaration.Changing the above line to 'YY_INITIAL_VALUE (static YYSTYPE yyval_default;)' as Bison 3.8.2 shows no error.