mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
c++: better "scope" a workaround for GCC
* data/skeletons/lalr1.cc: Enable it only for GCC 4.8 and before.
This commit is contained in:
@@ -664,10 +664,12 @@ m4_if(b4_prefix, [yy], [],
|
||||
std::ostream& yyoutput = yyo;
|
||||
YYUSE (yyoutput);
|
||||
symbol_number_type yytype = yysym.type_get ();
|
||||
#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408
|
||||
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
||||
// below array bounds".
|
||||
if (yysym.empty ())
|
||||
std::abort ();
|
||||
#endif
|
||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||
<< yysym.location << ": "])[;
|
||||
|
||||
Reference in New Issue
Block a user