]> git.saurik.com Git - bison.git/commit
Fix the problem with union yyalloc and C++.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Mar 2002 21:53:39 +0000 (21:53 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Mar 2002 21:53:39 +0000 (21:53 +0000)
commit897c1dd9a97a95f2ab28f550fde1702d83845bce
tree2cda34e185ec86f14bf11576b2efc358ef8528ef
parenta6624adaeec76c3b2d1ccb3a909c76261e417b19
Fix the problem with union yyalloc and C++.

* src/bison.simple (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES,
YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or if
this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
constructors or destructors.
(yymemcpy) [! defined YYSTACK_RELOCATE]: Do not define; not needed.
(yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.

* src/reader.c (parse_union_decl): Define YYSTYPE_IS_TRIVIAL if we
use our YYSTYPE.  It must be trivial, or our own union wouldn't be
valid C++ anyway.
(readgram): Define YYSTYPE_IS_TRIVIAL if it is int.
(reader_output_yylsp): Define YYLTYPE_IS_TRIVIAL if we use our
YYLTYPE.
ChangeLog