diff --git a/NEWS b/NEWS
index a5c7a99d..fd1cadd4 100644
--- a/NEWS
+++ b/NEWS
@@ -250,6 +250,8 @@ GNU Bison NEWS
Incorrect definitions of YY_, issued by yacc.c when no parser header is
generated, are removed.
+ All the generated headers are self-contained.
+
** Changes in the format of error messages
This used to be the format of many error reports:
@@ -2131,7 +2133,7 @@ along with this program. If not, see .
LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh
LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf
LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init
- LocalWords: TOK
+ LocalWords: TOK calc yyo fval
Local Variables:
mode: outline
diff --git a/README-hacking b/README-hacking
index 2b92edcf..988bd304 100644
--- a/README-hacking
+++ b/README-hacking
@@ -175,6 +175,19 @@ decide whether to update.
** make check
Use liberally.
+** Typical errors
+If the test suite shows failures such as the following one
+
+ .../bison/lib/getopt.h:196:8: error: redefinition of 'struct option'
+ /usr/include/getopt.h:54:8: error: previous definition of 'struct option'
+
+it probably means that some file was compiled without
+AT_DATA_SOURCE_PROLOGUE. This error is due to the fact that our -I options
+pick up gnulib's replacement headers, such as getopt.h, and this will go
+wrong if config.h was not included first.
+
+See tests/local.at for details.
+
** make maintainer-check-valgrind
This target uses valgrind both to check bison, and the generated parsers.
diff --git a/THANKS b/THANKS
index 19ec28a9..b83ec0e5 100644
--- a/THANKS
+++ b/THANKS
@@ -5,7 +5,7 @@ Airy Andre Airy.Andre@edf.fr
Akim Demaille akim@freefriends.org
Albert Chin-A-Young china@thewrittenword.com
Alexander Belopolsky alexb@rentec.com
-Alexandre Duret-Lutz adl@src.lip6.fr
+Alexandre Duret-Lutz adl@lrde.epita.fr
Andreas Schwab schwab@suse.de
Andrew Suffield asuffield@users.sourceforge.net
Angelo Borsotti angelo.borsotti@gmail.com
@@ -95,6 +95,7 @@ R Blake blakers@mac.com
Raja R Harinath harinath@cs.umn.edu
Ralf Wildenhues Ralf.Wildenhues@gmx.de
Richard Stallman rms@gnu.org
+Rob Vermaas rob.vermaas@gmail.com
Robert Anisko anisko_r@epita.fr
Satya Kiran Popuri satyakiran@gmail.com
Sebastian Setzer sebastian.setzer.ext@siemens.com
diff --git a/data/location.cc b/data/location.cc
index 218910b1..14688ca4 100644
--- a/data/location.cc
+++ b/data/location.cc
@@ -280,7 +280,7 @@ b4_copyright([Positions for Bison parsers in C++])[
]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[
# include // std::max
-# include
+# include
# include
]b4_null_define[
@@ -299,8 +299,6 @@ b4_copyright([Locations for Bison parsers in C++])[
]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[
-# include
-# include
# include "position.hh"
]b4_namespace_open[
diff --git a/doc/bison.texi b/doc/bison.texi
index 0e3a2500..4ab00c65 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -9426,13 +9426,23 @@ separated list of @var{things} among:
Description of the grammar, conflicts (resolved and unresolved), and
parser's automaton.
+@item itemset
+Implies @code{state} and augments the description of the automaton with
+the full set of items for each state, instead of its core only.
+
@item lookahead
Implies @code{state} and augments the description of the automaton with
each rule's lookahead set.
-@item itemset
-Implies @code{state} and augments the description of the automaton with
-the full set of items for each state, instead of its core only.
+@item solved
+Implies @code{state}. Explain how conflicts were solved thanks to
+precedence and associativity directives.
+
+@item all
+Enable all the items.
+
+@item none
+Do not generate the report.
@end table
@item --report-file=@var{file}
diff --git a/tests/headers.at b/tests/headers.at
index df0c0580..73095ce0 100644
--- a/tests/headers.at
+++ b/tests/headers.at
@@ -127,7 +127,8 @@ AT_SETUP([Several parsers])
# AT_TEST([PREFIX], [DIRECTIVES])
# -------------------------------
# Generate and compile to *.o. Make sure there is no (allowed) YY*
-# nor yy* identifiers in the header.
+# nor yy* identifiers in the header. Check that headers are
+# self-contained, and can be compiled by a C++ compiler.
m4_pushdef([AT_TEST],
[AT_BISON_OPTION_PUSHDEFS([%define api.prefix "$1_" $2])
AT_DATA_GRAMMAR([$1.AT_SKEL_CC_IF([yy], [y])],
@@ -243,6 +244,19 @@ AT_TEST([x8], [%define api.pure %define api.push-pull both])
AT_COMPILE_CXX([parser], [[x[1-8].o -DCC_IS_CXX=$CC_IS_CXX main.cc]])
AT_CHECK([./parser], [0], [[expout]])
+# Check that the headers are self-contained, and protected against
+# multiple inclusions. While at it, check they are sane for C++.
+for h in *.h *.hh
+do
+ # No shell expansion with AT_DATA.
+ cat >$h.cc <