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:
Akim Demaille
2019-01-20 18:21:41 +01:00
parent ec08b369ec
commit 7b3368a155

View File

@@ -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 << ": "])[;