> Le 3 févr. 2014 à 14:40, Antonio Correia <amsilvacorr...@yahoo.com> a écrit : > > Hi all, > > I was testing error recovery with bison and I'm getting this assertion here: > > > /// Instantiate an empty \a T in here. > template <typename T> > T& > build () > { > YYASSERT (!yytname_); > YYASSERT (sizeof (T) <= S); > yytname_ = typeid (T).name (); > return *new (yyas_<T> ()) T; > } > > when using this simple grammar. > > > %token <char> CHAR "char" > %token <int> NUM "number" > %token SEMICOLON ";" > %token END 0 "end of file" > > %% > > > stms : stms CHAR ";" > | CHAR ";" > | error ";" {yyerrok;} > ; > > %% > > > I've used bison 3.0.2 and flex 2.5.37. > I'm attaching all the code I used with this test. > > I was expecting two syntax error messages, and in fact I get those messages > when I remove the parse.assert definition. > > I used g++ *.cpp -o test to compile the code, after bison and flex steps.
Hi Antonio, Thanks a lot for the report. This was fixed (thanks to your ticket on Savannah). See http://lists.gnu.org/archive/html/bison-patches/2015-01/msg00008.html