bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tests: add noexcept to please GCC 9


From: Akim Demaille
Subject: tests: add noexcept to please GCC 9
Date: Sun, 8 Sep 2019 12:05:18 +0200

Pushed in master and maint (for 3.4.2).

commit 0b417c3479ca63a55cff5305a35e6eea3e7bc7a4
Author: Akim Demaille <address@hidden>
Date:   Sun Sep 8 12:02:30 2019 +0200

    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<std::allocator<_CharT> 
>::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, 
_Up*, _Args&& ...) [with _Up = string; _Args = {string}; _Tp = string; 
std::allocator_traits<std::allocator<_CharT> >::allocator_type = 
std::allocator<string>]'
        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<string>]'
        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<string>]'
        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<string>]'
        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<string>; std::true_type = 
std::integral_constant<bool, true>]'
        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<string>; std::vector<_Tp, _Alloc>::iterator = 
__gnu_cxx::__normal_iterator<string*, std::vector<string> >; 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<string>; 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<string>::_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.

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();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]