mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 02: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;
|
std::ostream& yyoutput = yyo;
|
||||||
YYUSE (yyoutput);
|
YYUSE (yyoutput);
|
||||||
symbol_number_type yytype = yysym.type_get ();
|
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
|
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
||||||
// below array bounds".
|
// below array bounds".
|
||||||
if (yysym.empty ())
|
if (yysym.empty ())
|
||||||
std::abort ();
|
std::abort ();
|
||||||
|
#endif
|
||||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||||
<< yysym.location << ": "])[;
|
<< yysym.location << ": "])[;
|
||||||
|
|||||||
Reference in New Issue
Block a user