output: do not generate source files when late errors are caught

Reported by Alexandre Duret-Lutz as "second problem" in:
http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html

* bootstrap.conf: We need the "unlink" module.
* src/files.h, src/files.c (unlink_generated_sources): New.
* src/output.c: Use it.
* tests/output.at: Check the case of late errors.
This commit is contained in:
Akim Demaille
2013-12-04 10:51:47 +01:00
parent ea99d6e6a0
commit 461983270c
5 changed files with 29 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ done
]AT_DATA([$1],
[$2[
%%
foo: {};
foo: %empty {};
]])[
]AT_BISON_CHECK([$3 $1], [$5], [], [ignore])[
@@ -126,6 +126,14 @@ AT_CHECK_OUTPUT([foo.y], [%type <foo> useless],
[foo.dot foo.output foo.xml],
[1])
# Do not generate code when there are late errors (even warnings as
# errors).
AT_CHECK_OUTPUT([foo.y], [%define useless],
[--defines --graph --xml --report=all -Wall -Werror],
[foo.dot foo.output foo.xml],
[1])
## ------------ ##
## C++ output. ##
## ------------ ##