From 0b417c3479ca63a55cff5305a35e6eea3e7bc7a4 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 8 Sep 2019 12:02:30 +0200 Subject: [PATCH] tests: add noexcept to please GCC 9 bison/tests/c++.at:552: bison --color=no -fno-caret -o list.cc list.y bison/tests/c++.at:552: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS stderr: gcc9/c++/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = string; _Args = {string}; _Tp = string]': gcc9/c++/bits/alloc_traits.h:482:2: required from 'static void std::allocator_traits >::construct(std::allocator_traits >::allocator_type&, _Up*, _Args&& ...) [with _Up = string; _Args = {string}; _Tp = string; std::allocator_traits >::allocator_type = std::allocator]' gcc9/c++/bits/stl_uninitialized.h:888:67: required from 'void std::__relocate_object_a(_Tp*, _Up*, _Allocator&) [with _Tp = string; _Up = string; _Allocator = std::allocator]' gcc9/c++/bits/stl_uninitialized.h:920:47: required from '_ForwardIterator std::__relocate_a_1(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = string*; _ForwardIterator = string*; _Allocator = std::allocator]' gcc9/c++/bits/stl_uninitialized.h:942:37: required from '_ForwardIterator std::__relocate_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = string*; _ForwardIterator = string*; _Allocator = std::allocator]' gcc9/c++/bits/stl_vector.h:430:35: required from 'static constexpr bool std::vector<_Tp, _Alloc>::_S_nothrow_relocate(std::true_type) [with _Tp = string; _Alloc = std::allocator; std::true_type = std::integral_constant]' gcc9/c++/bits/stl_vector.h:446:28: required from 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const string&}; _Tp = string; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator >; typename std::_Vector_base<_Tp, _Alloc>::pointer = string*]' gcc9/c++/bits/stl_vector.h:1195:4: required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = string; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::value_type = string]' list.y:126:110: required from here gcc9/c++/bits/vector.tcc:459:44: in 'constexpr' expansion of 'std::vector::_S_use_relocate()' list.y:41:7: error: but 'string::string(string&&)' does not throw; perhaps it should be declared 'noexcept' [-Werror=noexcept] 41 | string (string&& s) | ^~~~~~ * tests/c++.at (Variants): Add noexcept where appropriate. --- tests/c++.at | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/c++.at b/tests/c++.at index e2e73fc2..13902138 100644 --- a/tests/c++.at +++ b/tests/c++.at @@ -313,7 +313,7 @@ AT_DATA_GRAMMAR([list.y], } #if defined __cplusplus && 201103L <= __cplusplus - string (string&& s) + string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear();