Commit Graph

246 Commits

Author SHA1 Message Date
Akim Demaille
b2c381cd25 quotearg: avoid leaks
Reported by Tomasz Kłoczko.
https://lists.gnu.org/archive/html/bug-bison/2019-09/msg00008.html

* src/main.c (main): Free quotearg's memory later.
2019-09-22 18:15:36 +02:00
Akim Demaille
f8db8fe4d7 fix: don't die when EOF token is defined twice
With

    %token EOF 0 EOF 0

we get

    input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
        3 | %token EOF 0 EOF 0
          |              ^~~
    input.y:3.8-10: previous declaration
        3 | %token EOF 0 EOF 0
          |        ^~~
    Assertion failed: (nsyms == ntokens + nvars), function check_and_convert_grammar,
        file /Users/akim/src/gnu/bison/src/reader.c, line 839.

Reported by Marc Schönefeld.

* src/symtab.c (symbol_user_token_number_set): Register only the
first definition of the end of input token.
* tests/input.at (Symbol redeclared): Check that case.
2019-09-08 11:38:29 +02:00
Akim Demaille
f788ba2ab6 check for memory exhaustion
hash_initialize returns NULL when out of memory.  Check for it, and
die cleanly instead of crashing.

Reported by 江 祖铭 (Zu-Ming Jiang).
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00015.html

* src/muscle-tab.c, src/state.c, src/symtab.c, src/uniqstr.c:
Check the value returned by hash_initialize.
2019-09-08 11:38:29 +02:00
László Várady
e63811dd86 diagnostics: fix invalid error message indentation
https://lists.gnu.org/archive/html/bison-patches/2019-08/msg00007.html

When Bison is started with a flag that suppresses warning messages, the
error_message() function can produce a few gigabytes of indentation
because of a dangling pointer.

* src/complain.c (error_message): Don't reset indent_ptr here, but...
(complain_indent): here.
* tests/diagnostics.at (Indentation with message suppression): Check
this case.
2019-09-08 11:38:29 +02:00
Akim Demaille
9f26e6d6b3 thanks: fix an address 2019-05-22 18:09:04 +02:00
Akim Demaille
70c3f3ade5 doc: avoid Texinfo portability issues
Reported by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00024.html
Fixed by Karl Berry.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00034.html

* doc/bison.texi: Don't specify the langage, rely on the default.
Avoid blank pages.
2019-05-20 06:12:47 +02:00
Akim Demaille
c8e57e8159 diagnostics: don't crash when libtextstyle is installed
Reported by neok m4700.
https://lists.gnu.org/archive/html/bison-patches/2019-05/msg00025.html
https://github.com/akimd/bison/pull/11

* src/complain.c (complain_init_color): style_file_prepare _needs_ a
string as second argument.
2019-05-19 18:16:47 +02:00
Akim Demaille
de5207244b diagnostics: %pure-parser is obsolete
Reported by Uxio Prego.
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00029.html

* src/scan-gram.l, src/parse-gram.y (PERCENT_PURE_PARSER)
(handle_pure_parser): New.
Issue a deprecation/update notice for %pure-parser.
* doc/bison.texi (Java Bison Interface): Don't mention %pure-parser.
* tests/actions.at, tests/input.at: Adjust.
2019-05-19 10:05:18 +02:00
Akim Demaille
a1a847bfb5 CI: use a pipeline: first build the tarball, then check it
Build the tarball in one job, check it in many.
Unfortunately no real gain in overall duration.
With help from Clément Démoulins.

* .travis.yml: here.
Remove all the tricks that were used to be able to boostrap on old
distros.
(before_install): Merge into 'script', because before_install applies
to all the jobs, and we don't want to run it for the 'compile' job.
2019-05-19 09:45:27 +02:00
Akim Demaille
ab3eaff7c4 doc: use colors for diagnostics in TeX too
Thanks to Gavin Smith and Patrice Dumas.
http://lists.gnu.org/archive/html/help-texinfo/2019-04/msg00015.html

* doc/bison.texi (@colorWarning, @colorError, @colorNotice)
(@colorOff): Define for TeX and HTML.
(@dwarning, @derror, @dnotice): Use them.
2019-05-09 19:21:02 +02:00
Akim Demaille
a992a3cb9e diagnostics: don't try to quote special files
Based on a report by Todd Freed.
http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00000.html
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90034

* src/location.c (caret_info): Also track the file name.
(location_caret): Don't quote special files.
2019-04-23 18:29:10 +02:00
Akim Demaille
bbf37f2534 lalr: fix segmentation violation
The "includes" relation [DeRemer 1982] is between gotos, so of course,
for a given goto, there cannot be more that ngotos (number of gotos)
images.  But we manipulate the set of images of a goto as a list,
without checking that an image was not already introduced.  So we can
"register" way more images than ngotos, leading to a crash (heap
buffer overflow).

Reported by wcventure.
http://lists.gnu.org/archive/html/bug-bison/2019-03/msg00007.html

For the records, this bug is present in the first committed version of
Bison.

* src/lalr.c (build_relations): Don't insert the same goto several
times.
* tests/sets.at (Build Relations): New.
2019-03-30 10:10:39 +01:00
Akim Demaille
6289d673a0 examples: add an example with a reentrant parser in Flex+Bison
Suggested by Eric S. Raymond.
https://lists.gnu.org/archive/html/bison-patches/2019-02/msg00066.html

* examples/c/reentrant-calc/Makefile, examples/c/reentrant-calc/README.md,
* examples/c/reentrant-calc/parse.y, examples/c/reentrant-calc/scan.l
* examples/c/reentrant-calc/lexcalc.test,
* examples/c/reentrant-calc/local.mk:
New.
2019-02-17 11:31:51 +01:00
Akim Demaille
cacdfc2f6e gram: fix handling of nterms in actions when some are unused
Since Bison 3.3, semantic values in rule actions (i.e., '$...') are
passed to the m4 backend as the symbol number.  Unfortunately, when
there are unused symbols, the symbols are renumbered _after_ the
numbers were used in the rule actions.  As a result, the evaluation of
the skeleton failed because it used non existing symbol numbers.
Which is the happy scenario: we could use numbers of other existing
symbols...

Reported by Balázs Scheidler.
http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00044.html

Translating the rule actions after the symbol renumbering moves too
many parts in bison.  Relying on the symbol identifiers is more
troublesome than it might first seem: some don't have an
identifier (tokens with only a literal string), some might have a
complex one (tokens with a literal string with characters special for
M4).  Well, these are tokens, but nterms also have issues: "dummy"
nterms (for midrule actions) are named $@32 etc. which is risky for
M4.

Instead, let's simply give M4 the mapping between the old numbers and
the new ones.  To avoid confusion between old and new numbers, always
emit pre-renumbering numbers as "orig NUM".

* data/README: Give details about "orig NUM".
* data/skeletons/bison.m4 (__b4_symbol, _b4_symbol): Resolve the
"orig NUM".
* src/output.c (prepare_symbol_definitions): Pass nterm_map to m4.
* src/reduce.h, src/reduce.c (nterm_map): Extract it from
nonterminals_reduce, to make it public.
(reduce_free): Free it.
* src/scan-code.l (handle_action_dollar): When referring to a nterm,
use "orig NUM".
* tests/reduce.at (Useless Parts): New, based Balázs Scheidler's
report.
2019-02-03 10:05:53 +01:00
Akim Demaille
2471733f1a package: bump copyrights to 2019 2019-01-05 14:58:05 +01:00
Akim Demaille
a4ede8f85b package: make bison a relocatable package
Suggested by David Barto
https://lists.gnu.org/archive/html/help-bison/2015-02/msg00004.html
and Victor Zverovich.
https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00121.html

This is very easy to do, thanks to work by Bruno Haible in gnulib.
See "Supporting Relocation" in gnulib's documentation.

* bootstrap.conf: We need relocatable-prog and relocatable-script (for yacc).

* src/yacc.in: New.
* configure.ac, src/local.mk: Instantiate it.
* src/main.c, src/output.c (main, pkgdatadir): Use relocatable2.

* doc/bison.texi (FAQ): Document it.
2018-12-25 10:05:36 +01:00
Akim Demaille
807bf60cfc c++: fix double free when a symbol_type was moved
Currently the following piece of code crashes (with parse.assert),
because we don't record that s was moved-from, and we invoke its dtor.

    {
      auto s = parser::make_INT (42);
      auto s2 = std::move (s);
    }

Reported by Wolfgang Thaller.
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00077.html

* data/c++.m4 (by_type): Provide a move-ctor.
(basic_symbol): Be sure not to read a moved-from value.
* tests/c++.at (C++ Variant-based Symbols Unit Tests): Check this case.
2018-12-24 18:58:56 +01:00
Akim Demaille
4a42a4f911 d: add skeleton for the D language
Contributed by Oliver Mangold.
https://lists.gnu.org/archive/html/help-bison/2012-01/msg00000.html

* README-D.txt, d-skel.m4, d.m4, lalr1.d: New.
2018-12-04 20:29:28 +01:00
Akim Demaille
4e510c69b1 c++: using macros around user types breaks when they include comma
We may generate code such as

    basic_symbol (typename Base::kind_type t, YY_RVREF (std::pair<int,int>) v);

which, of course, breaks, because YY_RVREF sees two arguments.  Let's
not play tricks with _VA_ARGS__, I'm unsure about it portability.
Anyway, I plan to change more things in this area.

Reported by Sébastien Villemot.
http://lists.gnu.org/archive/html/bug-bison/2018-11/msg00014.html

* data/variant.hh (b4_basic_symbol_constructor_declare)
(b4_basic_symbol_constructor_define): Don't use macro on user types.
* tests/types.at: Check that we support pairs.
2018-11-20 20:01:50 +01:00
Akim Demaille
05e70adf22 build: fix issues in the generated tarball
Reported by Andre da Costa Barros.
https://savannah.gnu.org/patch/?9716

* examples/calc++/local.mk: We no longer generate position.hh and
stack.hh.  Leaving them here triggers their concurrent generation,
which fails.
(%C%_calc___CPPFLAGS): Fix the extracted headers in the source tree.
* examples/mfcalc/local.mk (%C%_mfcalc_CPPFLAGS): Ditto.
2018-11-08 08:33:16 +01:00
Akim Demaille
7efe0b5da3 build: fix typo
Reported by Horst Von Brand.
https://savannah.gnu.org/support/?109580

* examples/local.mk (.PHOMY): Rename as...
(.PHONY): this.
2018-11-07 21:51:27 +01:00
Akim Demaille
4fd1fc70e0 examples: ship them
Currently, the examples are extracted on the user's side.
Unfortunately, that requires that the user has Perl, which is
otherwise not needed for Bison.  Let's ship the examples instead.

The examples were handled this way so that we could depend on
configure flags: if --enable-gcc-warnings is passed, it is understood
as "I'm a maintainer", so the examples are generated with `#line`s.
Regular users should not see them, so they are now unconditionally
removed when rolling a tarball.

Reported by Mike Frysinger.
https://lists.gnu.org/archive/html/bison-patches/2015-04/msg00000.html

* examples/local.mk: Ship all the extracted files.
(examples-unline): New.
Make sure that the generated tarballs do not contain the #lines.
2018-11-06 13:23:13 +01:00
Adam Sampson
3bf429aed8 examples: #include <cstring> in calc++
strerror is defined by <string.h>, and recent versions of GNU libstdc++
no longer include this automatically from <string>.
2018-11-02 10:20:30 +01:00
Akim Demaille
e605ad9679 build: fix use of gnulib Make variables
Reported by Kiyoshi Kanazawa.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00048.html

* lib/local.mk (lib_libbison_a_LIBADD): Merge into...
* src/local.mk (src_bison_LDADD): here.
2018-10-30 07:01:21 +01:00
Akim Demaille
d2192653db build: add missing gnulib libs
Reported by Denis Excoffier.

* lib/local.mk, src/local.mk: here.
2018-10-20 09:11:22 +02:00
Akim Demaille
0299b699bb THANKS: add Josh Soref 2018-10-05 07:06:44 +02:00
Akim Demaille
a990213582 timevar: don't declare getrusage if we don't use it
This fails on MinGW.
Reported by Simon Sobisch.
http://lists.gnu.org/archive/html/bug-bison/2018-09/msg00058.html

* lib/timevar.c: Don't provide default prototypes for functions
we don't use.
2018-09-22 15:58:27 +02:00
Akim Demaille
2d7e743802 examples: beware of shell portability issues
Some shells don't grok `local var=$val` very well: they need the rhs
to be quoted.

    ./examples/test: 66: local: you.,: bad variable name
    FAIL examples/variant.test (exit status: 2)

Reported by Étienne Renault.

* examples/test (run): Quote the values in 'local' assignments.
2018-09-02 09:37:53 +02:00
Akim Demaille
44e76d801f lalr1.cc: support compilation with disabled support for exceptions
Reported by Brooks Moses <bmoses@google.com>
http://lists.gnu.org/archive/html/bison-patches/2018-02/msg00000.html

* data/lalr1.cc (YY_EXCEPTIONS): New.
Use it to disable try/catch clauses.

* doc/bison.texi (C++ Parser Interface): Document it.

* configure.ac (CXXFLAGS_NO_EXCEPTIONS): New.
* tests/atlocal.in: Receive it.
* tests/local.at (AT_FULL_COMPILE, AT_LANG_COMPILE):
Accept a new argument, extra compiler flags.
* tests/calc.at: Run the C++ calculator with exception support disabled.
2018-08-19 17:47:59 +02:00
Akim Demaille
f348522005 C++: fix portability issue with MSVC 2017
Visual Studio issues a C4146 warning on '-static_cast<unsigned>(rhs)'.
The code is weird, probably to cope with INT_MIN.  Let's go back to
using std::max (whose header is still included in position.hh...) like
originally, but with the needed casts.

Reported by 長田偉伸, and with help from Rici Lake.

See also
http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html
and commit 75ae829984.

* data/location.cc (position::add_): Take min as an int.
Use std::max.
While here, get rid of a couple of useless inlines.
2018-08-18 18:07:43 +02:00
Akim Demaille
e866c476fd build: fix concurrent build failure
Reported by Dengke Du and Robert Yang.
https://lists.gnu.org/archive/html/bison-patches/2017-07/msg00000.html

* src/local.mk (src/yacc): Make sure the directory exists.
2018-08-18 15:37:14 +02:00
Akim Demaille
425044a936 doc: clarify the destructor selection example
Reported by Gary L Peskin.
http://lists.gnu.org/archive/html/help-bison/2016-02/msg00000.html

* doc/bison.texi (Destructor Decl): here.
2018-08-18 14:15:21 +02:00
Akim Demaille
5010af94d0 portability: don't use _Pragma with ICC
ICC defines __GNUC__ [1], but does not support GCC's _Pragma for
diagnostics.  As a matter of fact, I believe it does not support
_Pragma at all (only #pragma) [2].

Reported by Maxim Prohorenko.
https://savannah.gnu.org/support/index.php?108339

[1] https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-gcc-compatibility-and-interoperability
[2] https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-pragmas

* data/c.m4 (YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN): Exclude ICC from
the club.
2018-08-18 14:15:13 +02:00
Akim Demaille
adf0425d11 escape properly the file names in #line for printer/destructor
Reported by Jannick.
http://lists.gnu.org/archive/html/bug-bison/2017-05/msg00001.html

"Amusingly" enough, we have the same problem with %defines when the
parser file name has backslashes or quotes: we generate #includes with
an incorrect C string.

* src/output.c (prepare_symbol_definitions): Escape properly the file
names before passing them to M4.
* data/bison.m4, data/lalr1.cc: Don't simply put the file name between
two quotes (that should have been strong enough a smell...), expect
the string to be properly quoted.
* tests/synclines.at: New tests to check this.
2018-08-18 10:04:50 +02:00
Akim Demaille
7b24c424b5 add support for typed mid-rule actions
Prompted on Piotr Marcińczyk's message:
http://lists.gnu.org/archive/html/bug-bison/2017-06/msg00000.html.
See also http://lists.gnu.org/archive/html/bug-bison/2018-06/msg00001.html.

Because their type is unknown to Bison, the values of midrule actions are
not treated like the others: they don't have %printer and %destructor
support.  In addition, in C++, (Bison) variants cannot work properly.

Typed midrule actions address these issues.  Instead of:

    exp: { $<ival>$ = 1; } { $<ival>$ = 2; }   { $$ = $<ival>1 + $<ival>2; }

write:

    exp: <ival>{ $$ = 1; } <ival>{ $$ = 2; }   { $$ = $1 + $2; }

* src/scan-code.h, src/scan-code.l (code_props): Add a `type` field to
record the declared type of an action.
(code_props_rule_action_init): Add a type argument.
* src/parse-gram.y: Accept an optional type tag for actions.
* src/reader.h, src/reader.c (grammar_current_rule_action_append): Add
a type argument.
(grammar_midrule_action): When a mid-rule is typed, pass its type to
the defined dummy non terminal symbol.
2018-08-11 18:09:29 +02:00
Akim Demaille
3df32101e7 warnings: address -Wnull-dereference in reader.c
Based on a patch by David Michael.
http://lists.gnu.org/archive/html/bison-patches/2018-07/msg00000.html

* src/reader.c (find_start): New, extracted from...
(check_and_convert_grammar): here.
2018-08-05 20:25:58 +02:00
Akim Demaille
0ac08d2d6c THANKS: update an address 2018-05-30 19:18:04 +02:00
Akim Demaille
f3bd6a25bf Replace ftp with https
Reported by Hans Åberg.

* README, cfg.mk, doc/bison.texi: here.
2018-05-29 07:28:02 +02:00
Akim Demaille
d17dc9a8b5 C++: fix -Wdeprecated warnings
For instance on test 99:

    In file included from @@.cc:56:
    @@.hh:409:26: error: definition of implicit copy constructor for
                         'stack_symbol_type' is deprecated because it
                         has a user-declared copy assignment operator
                         [-Werror,-Wdeprecated]
          stack_symbol_type& operator= (const stack_symbol_type& that);
                         ^

Reported by Derek Clegg.
https://lists.gnu.org/archive/html/bison-patches/2018-05/msg00036.html

* configure.ac (warn_tests): Add -Wdeprecated.
* data/lalr1.cc (stack_symbol_type): Add an explicit copy ctor.
We cannot rely on the explicit default implementation (`= default`)
as we support C++ 98.
2018-05-27 10:03:57 +02:00
Akim Demaille
2e9e591889 Update copyright years
Run `make update-copyright`.
2018-05-12 18:18:41 +02:00
Nate Guerin
a6ec9ca2f1 Add a missing word in the documentation
Small patch adds the word 'to' to the documentation.
2018-05-12 18:13:37 +02:00
Akim Demaille
75fbe357c8 doc: fixes in the C++ part
Reported by Askar Safin.

http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00018.html
http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00019.html

* doc/bison.texi (Split Symbols): Fix access to token types.
yylval is a pointer, so use ->.
Fix coding style issues: space before paren.
2015-03-03 16:31:31 +01:00
Akim Demaille
a668f48631 tests: be robust to platforms that support UTF-8 even with LC_ALL=C
Because musl supports UTF-8 with LC_ALL=C, gcc produces:

  input.y: In function ‘yyparse’:

instead of:

  input.y: In function 'yyparse':

Reported by Ferdinand Thiessen.
http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00001.html

* tests/synclines.at (AT_SYNCLINES_COMPILE): Skip syncline tests when
we can't trust error messages issued about a function body.
2015-02-10 14:56:30 +01:00
Akim Demaille
16832bf546 build: fix some warnings
Reported by John Horigan.
http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00034.html

* src/graphviz.c, src/symtab.h: Address compiler warnings.
2015-01-18 15:41:15 +01:00
Akim Demaille
0ab29b7c20 build: avoid infinite recursions on include_next
On MacOS X 10.5 PPC with Apple's GCC 4.0.1:

  % uname -a
  Darwin aria.cielonegro.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:0
  1 PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
  % gcc --version
  powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
  Copyright (C) 2005 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

building in place enters into an infinite recursion on "#include_next":

  % gmake V=1
  [snip]
  depbase=`echo lib/math.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
  gcc -std=gnu99    -I. -Ilib -I. -I./lib   -g -O2 -MT lib/math.o -MD -MP -MF $depbase.Tpo -c -o lib/math.o lib/math.c &&\
  mv -f $depbase.Tpo $depbase.Po
  In file included from lib/math.h:27,
                   from lib/math.h:27,
                   from lib/math.h:27,
                   from lib/math.h:27,
  [snip]
                   from lib/math.h:27,
                   from lib/math.h:27,
                   from lib/math.c:3:
  lib/math.h:27:23: error: #include nested too deeply
  Makefile:3414: recipe for target 'lib/math.o' failed
  gmake[2]: *** [lib/math.o] Error 1

Using -I./lib instead of -Ilib fixes the problem.

Reported by Pho.
<https://lists.gnu.org/archive/html/bison-patches/2014-01/msg00000.html>

* Makefile.am (AM_CPPFLAGS): Use -I./lib instead of -Ilib.
2015-01-16 10:52:17 +01:00
Akim Demaille
9a91e7f246 doc: liby's main arms the internationalization
Reported by Nicolas Bedon.
<https://lists.gnu.org/archive/html/bug-bison/2014-11/msg00005.html>

* doc/bison.texi (Yacc Library): Document the call the setlocale.
2015-01-12 11:37:24 +01:00
Akim Demaille
671850a1c3 bison: avoid warnings from static code analysis
A static analysis tool reports that some callers of symbol_list_n_get
might get NULL and not handle it properly.  This is not the case, yet
we can suppress this pattern.

Reported by Mike Sullivan.
<https://lists.gnu.org/archive/html/bug-bison/2013-12/msg00027.html>

* src/symlist.c (symbol_list_n_get): Actually it is never called
to return 0.  Enforce this postcondition via aver.
(symbol_list_n_type_name_get): Simplify accordingly.  In particular,
discards a (translated) useless error message.
* src/symlist.h: Adjust documentation.
* src/scan-code.l: Style change.
2015-01-09 15:27:59 +01:00
Akim Demaille
ee028dceff 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.
2015-01-09 13:54:58 +01:00
Akim Demaille
ee2f433512 c++: provide a means to clear symbols
The symbol destructor is currently the only means to clear a symbol.
Unfortunately during error recovery we might have to clear the
lookahead, which is a local variable (yyla) that has not yet reached
its end of scope.

Rather that duplicating the code to destroy a symbol, or rather than
destroying and recreating yyla, let's provide a means to clear a
symbol.

Reported by Antonio Silva Correia, with an analysis from Michel d'Hooge.
<http://savannah.gnu.org/support/?108481>

* data/c++.m4, data/lalr1.cc (basis_symbol::clear, by_state::clear)
(by_type::clear): New.
(basic_symbol::~basic_symbol): Use clear.
2015-01-08 16:07:59 +01:00
Akim Demaille
7cf84b13a0 c++: variants: comparing addresses of typeid.name() is undefined
Instead of storing and comparing pointers to names of types, store
pointers to the typeids, and compares the typeids.
Reported by Thomas Jahns.
<http://lists.gnu.org/archive/html/bug-bison/2014-03/msg00001.html>

* data/variant.hh (yytname_): Replace with...
(yytypeid_): this.
2015-01-07 10:34:07 +01:00