c++: variants: don't leak the lookahead in error recovery

During error recovery, when discarding the lookeahead, we don't
destroy it, which is caught by parse.assert assertions.

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

* tests/c++.at (Variants): Strengthen the test to try syntax errors
with discarded lookahead.
This commit is contained in:
Akim Demaille
2015-01-08 11:19:57 +01:00
parent ee2f433512
commit 00cebd11d4
2 changed files with 44 additions and 26 deletions

View File

@@ -901,6 +901,7 @@ b4_dollar_popdef])[]dnl
else if (!yyempty)
{
yy_destroy_ ("Error: discarding", yyla);
yyla.clear ();
yyempty = true;
}
}