diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2022-08-01 07:08:52 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2022-08-01 07:08:52 +0200 |
commit | 722070124e991ee93ec3ffbde631b5f3713cd9f0 (patch) | |
tree | 74b980a25e7219f8ff41f6a571bf206daa73a456 /data | |
parent | 657dbff05cc352bd4212b799004a5e4513532724 (diff) | |
download | bison-722070124e991ee93ec3ffbde631b5f3713cd9f0.tar.gz |
lalr1.cc: declare stack_symbol_type as noexcept
Many C++ tests (400-25, 440-53, 664-5, 667-76, 679-80, 682-3, 685-9,
692) failed with GCC 12.1:
```
test.cc:843:28: required from here
/opt/local/include/gcc12/c++/bits/stl_construct.h:95:14: error: noexcept-expression evaluates to 'false' because of a call to 'yy::parser::stack_symbol_type::stack_symbol_type()' [-Werror=noexcept]
95 | noexcept(noexcept(::new((void*)0) _Tp(std::declval<_Args>()...)))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cc:990:3: note: but 'yy::parser::stack_symbol_type::stack_symbol_type()' does not throw; perhaps it should be declared 'noexcept'
990 | parser::stack_symbol_type::stack_symbol_type ()
| ^~~~~~
```
Reported by Paul Eggert.
<https://lists.gnu.org/r/bison-patches/2022-07/msg00008.html>
* data/skeletons/lalr1.cc (stack_symbol_type::stack_symbol_type()):
Declare noexcept.
Diffstat (limited to 'data')
-rw-r--r-- | data/skeletons/lalr1.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc index ce4c6a3d..240f4c36 100644 --- a/data/skeletons/lalr1.cc +++ b/data/skeletons/lalr1.cc @@ -425,7 +425,7 @@ m4_define([b4_shared_declarations], /// Superclass. typedef basic_symbol<by_state> super_type; /// Construct an empty symbol. - stack_symbol_type (); + stack_symbol_type () YY_NOEXCEPT; /// Move or copy construction. stack_symbol_type (YY_RVREF (stack_symbol_type) that); /// Steal the contents from \a sym to build this. @@ -678,7 +678,7 @@ m4_if(b4_prefix, [yy], [], return YY_CAST (symbol_kind_type, yystos_[+state]); } - ]b4_parser_class[::stack_symbol_type::stack_symbol_type () + ]b4_parser_class[::stack_symbol_type::stack_symbol_type () YY_NOEXCEPT {} ]b4_parser_class[::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) |