mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
c++: use noexcept where appropriate
Reported by Don Macpherson. https://github.com/akimd/bison/issues/63 https://github.com/akimd/bison/issues/64 * data/skeletons/c++.m4, data/skeletons/lalr1.cc: here.
This commit is contained in:
@@ -339,7 +339,7 @@ m4_define([b4_symbol_type_define],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy contents, and record that is empty.
|
/// Destroy contents, and record that is empty.
|
||||||
void clear ()
|
void clear () YY_NOEXCEPT
|
||||||
{]b4_variant_if([[
|
{]b4_variant_if([[
|
||||||
// User destructor.
|
// User destructor.
|
||||||
symbol_kind_type yykind = this->kind ();
|
symbol_kind_type yykind = this->kind ();
|
||||||
@@ -423,7 +423,7 @@ m4_define([b4_symbol_type_define],
|
|||||||
by_kind (kind_type t);
|
by_kind (kind_type t);
|
||||||
|
|
||||||
/// Record that this symbol is empty.
|
/// Record that this symbol is empty.
|
||||||
void clear ();
|
void clear () YY_NOEXCEPT;
|
||||||
|
|
||||||
/// Steal the symbol kind from \a that.
|
/// Steal the symbol kind from \a that.
|
||||||
void move (by_kind& that);
|
void move (by_kind& that);
|
||||||
@@ -543,7 +543,7 @@ m4_define([b4_public_types_define],
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
]b4_inline([$1])[void
|
]b4_inline([$1])[void
|
||||||
]b4_parser_class[::by_kind::clear ()
|
]b4_parser_class[::by_kind::clear () YY_NOEXCEPT
|
||||||
{
|
{
|
||||||
kind_ = ]b4_symbol(empty, kind)[;
|
kind_ = ]b4_symbol(empty, kind)[;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,9 +270,9 @@ m4_define([b4_shared_declarations],
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
context (const ]b4_parser_class[& yyparser, const symbol_type& yyla);
|
context (const ]b4_parser_class[& yyparser, const symbol_type& yyla);
|
||||||
const symbol_type& lookahead () const { return yyla_; }
|
const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
|
||||||
symbol_kind_type token () const { return yyla_.kind (); }]b4_locations_if([[
|
symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); }]b4_locations_if([[
|
||||||
const location_type& location () const { return yyla_.location; }
|
const location_type& location () const YY_NOEXCEPT { return yyla_.location; }
|
||||||
]])[
|
]])[
|
||||||
/// Put in YYARG at most YYARGN of the expected tokens, and return the
|
/// Put in YYARG at most YYARGN of the expected tokens, and return the
|
||||||
/// number of tokens stored in YYARG. If YYARG is null, return the
|
/// number of tokens stored in YYARG. If YYARG is null, return the
|
||||||
|
|||||||
Reference in New Issue
Block a user