[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/22] c++: use noexcept where appropriate
From: |
Akim Demaille |
Subject: |
[PATCH 04/22] c++: use noexcept where appropriate |
Date: |
Sat, 23 Jan 2021 15:55:43 +0100 |
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.
---
data/skeletons/c++.m4 | 6 +++---
data/skeletons/lalr1.cc | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/data/skeletons/c++.m4 b/data/skeletons/c++.m4
index 78c66def8..5081273fb 100644
--- a/data/skeletons/c++.m4
+++ b/data/skeletons/c++.m4
@@ -340,7 +340,7 @@ m4_define([b4_symbol_type_define],
}
/// Destroy contents, and record that is empty.
- void clear ()
+ void clear () YY_NOEXCEPT
{]b4_variant_if([[
// User destructor.
symbol_kind_type yykind = this->kind ();
@@ -424,7 +424,7 @@ m4_define([b4_symbol_type_define],
by_kind (kind_type t);
/// Record that this symbol is empty.
- void clear ();
+ void clear () YY_NOEXCEPT;
/// Steal the symbol kind from \a that.
void move (by_kind& that);
@@ -544,7 +544,7 @@ m4_define([b4_public_types_define],
{}
]b4_inline([$1])[void
- ]b4_parser_class[::by_kind::clear ()
+ ]b4_parser_class[::by_kind::clear () YY_NOEXCEPT
{
kind_ = ]b4_symbol(-2, kind)[;
}
diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc
index b95f9aa9a..6214f96fb 100644
--- a/data/skeletons/lalr1.cc
+++ b/data/skeletons/lalr1.cc
@@ -271,9 +271,9 @@ m4_define([b4_shared_declarations],
{
public:
context (const ]b4_parser_class[& yyparser, const symbol_type& yyla);
- const symbol_type& lookahead () const { return yyla_; }
- symbol_kind_type token () const { return yyla_.kind ();
}]b4_locations_if([[
- const location_type& location () const { return yyla_.location; }
+ const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; }
+ symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind ();
}]b4_locations_if([[
+ const location_type& location () const YY_NOEXCEPT { return
yyla_.location; }
]])[
/// 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
--
2.30.0
- [PATCH 00/22] maint: prepare 3.7.5, Akim Demaille, 2021/01/23
- [PATCH 01/22] c: adjust _Noreturn to pedantic clang, Akim Demaille, 2021/01/23
- [PATCH 02/22] autoconf: update, Akim Demaille, 2021/01/23
- [PATCH 03/22] examples: avoid "unbound variable" errors, Akim Demaille, 2021/01/23
- [PATCH 04/22] c++: use noexcept where appropriate,
Akim Demaille <=
- [PATCH 05/22] tables: avoid warnings and save bits, Akim Demaille, 2021/01/23
- [PATCH 06/22] glr.cc: don't "leak" yyparse, Akim Demaille, 2021/01/23
- [PATCH 07/22] c++: I'm tired of Flex's warnings, Akim Demaille, 2021/01/23
- [PATCH 08/22] cex: send traces to stderr, not stdout, Akim Demaille, 2021/01/23
- [PATCH 09/22] cex: add support for $TIME_LIMIT, Akim Demaille, 2021/01/23
- [PATCH 10/22] cex: fix traces: add missing end-of-lines, Akim Demaille, 2021/01/23
- [PATCH 11/22] cex: fix traces: fix display of disabled items, Akim Demaille, 2021/01/23
- [PATCH 12/22] package: codespell, Akim Demaille, 2021/01/23
- [PATCH 13/22] style: YYUSE is private, make it YY_USE, Akim Demaille, 2021/01/23
- [PATCH 14/22] skeletons: introduce "slot"s for symbols, Akim Demaille, 2021/01/23