Skip to content

Commit

Permalink
Merge pull request #443 from ydah/fix-error-in-cpp
Browse files Browse the repository at this point in the history
Fix an error for initialization within YY_INITIAL_VALUE() with C++
  • Loading branch information
ydah authored Jun 17, 2024
2 parents bed4527 + be9b052 commit 85efe0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions template/bison/yacc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,11 @@ int yychar;
/* The semantic value of the lookahead symbol. */
/* Default value used for initialization, for pacifying older GCCs
or non-GCC compilers. */
#ifdef __cplusplus
static const YYSTYPE yyval_default = YY_INITIAL_VALUE(YYSTYPE());
#else
YY_INITIAL_VALUE (static const YYSTYPE yyval_default;)
#endif
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);

/* Location data for the lookahead symbol. */
Expand Down

0 comments on commit 85efe0e

Please sign in to comment.