From patchwork Tue Sep 17 18:44:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 275522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BE3572C009A for ; Wed, 18 Sep 2013 04:47:00 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:reply-to:to:cc:subject:message-id:mime-version :content-type; q=dns; s=default; b=JvH/uHOFpgZw/FV6cMiwO+1TZGUoc kT9KBB2Ue8UuoF34TNGqVQBPzwe0eW3DHrHYuF8eArybRGSb+XczboHWD5iD6aJn jfMHMaf13t0Wefr151HJ40BunkjMH48/7qqvOS5jPmbxzJatJHUbw29tMyp1laVR CTiqiI6AzA81Dw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:reply-to:to:cc:subject:message-id:mime-version :content-type; s=default; bh=LutqI2gh9JpvEGU10IvYtSTpUYU=; b=s7C YzIL5s+AEww/2k/YmMRDVjjDylngm0LLPANmY2NN/pi+4voCbRmwZqBk2M0gE80p vv9dLlnUnaxua0g+nhHVsI0kmWdYzomNXajKCwmFKyVdMxWpAnL/LrO3TxraZHqr tgsIjtNubpFREmMJpHFdIHT/zCBrY7b7Sx80EgJs= Received: (qmail 16677 invoked by alias); 17 Sep 2013 18:44:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 16607 invoked by uid 89); 17 Sep 2013 18:44:52 -0000 Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 17 Sep 2013 18:44:52 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RDNS_NONE autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail3-relais-sop.national.inria.fr Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 17 Sep 2013 20:44:26 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1VM0GA-0007GN-09; Tue, 17 Sep 2013 20:44:26 +0200 Date: Tue, 17 Sep 2013 20:44:25 +0200 (CEST) From: Marc Glisse Reply-To: libstdc++@gcc.gnu.org To: libstdc++@gcc.gnu.org cc: gcc-patches@gcc.gnu.org Subject: [v3] More noexcept for lists Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Hello, after vectors, lists. I didn't touch the throw we were discussing earlier today for now. There will be an inconsistency with debug list iterators because they use a general wrapper: - I would need François to tell if that wrapper is ever used with iterators that can throw, - the same wrapper is used for several containers, so unless we change all containers at once it can't stay consistent. Bootstrap+testsuite ok. 2013-09-18 Marc Glisse PR libstdc++/58338 * include/bits/list.tcc (_List_base::_M_clear, list::erase): Mark as noexcept. * include/bits/stl_list.h (_List_iterator) [_List_iterator, _M_const_cast, operator*, operator->, operator++, operator--, operator==, operator!=]: Likewise. (_List_const_iterator) [_List_const_iterator, _M_const_cast, operator*, operator->, operator++, operator--, operator==, operator!=]: Likewise. (operator==(const _List_iterator&, const _List_const_iterator&), operator!=(const _List_iterator&, const _List_const_iterator&)): Likewise. (_List_impl) [_List_impl(const _Node_alloc_type&), _List_impl(_Node_alloc_type&&)]: Likewise. (_List_base) [_M_put_node, _List_base(const _Node_alloc_type&), _List_base(_List_base&&), _M_clear, _M_init]: Likewise. (list) [list(), list(const allocator_type&)]: Merge. (list) [list(const allocator_type&), front, back, pop_front, pop_back, erase, _M_erase]: Mark as noexcept. * include/debug/list (list) [list(const _Allocator&), front, back, pop_front, pop_back, _M_erase, erase]: Likewise. * include/profile/list (list) [list(const _Allocator&), front, back, pop_front, pop_back, erase]: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Adjust line number. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. Index: include/bits/list.tcc =================================================================== --- include/bits/list.tcc (revision 202655) +++ include/bits/list.tcc (working copy) @@ -56,21 +56,21 @@ #ifndef _LIST_TCC #define _LIST_TCC 1 namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_CONTAINER template void _List_base<_Tp, _Alloc>:: - _M_clear() + _M_clear() _GLIBCXX_NOEXCEPT { typedef _List_node<_Tp> _Node; _Node* __cur = static_cast<_Node*>(_M_impl._M_node._M_next); while (__cur != &_M_impl._M_node) { _Node* __tmp = __cur; __cur = static_cast<_Node*>(__cur->_M_next); #if __cplusplus >= 201103L _M_get_Node_allocator().destroy(__tmp); #else @@ -138,21 +138,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER return __it; } return __position._M_const_cast(); } #endif template typename list<_Tp, _Alloc>::iterator list<_Tp, _Alloc>:: #if __cplusplus >= 201103L - erase(const_iterator __position) + erase(const_iterator __position) noexcept #else erase(iterator __position) #endif { iterator __ret = iterator(__position._M_node->_M_next); _M_erase(__position._M_const_cast()); return __ret; } #if __cplusplus >= 201103L Index: include/bits/stl_list.h =================================================================== --- include/bits/stl_list.h (revision 202655) +++ include/bits/stl_list.h (working copy) @@ -126,76 +126,76 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { typedef _List_iterator<_Tp> _Self; typedef _List_node<_Tp> _Node; typedef ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef _Tp* pointer; typedef _Tp& reference; - _List_iterator() + _List_iterator() _GLIBCXX_NOEXCEPT : _M_node() { } explicit - _List_iterator(__detail::_List_node_base* __x) + _List_iterator(__detail::_List_node_base* __x) _GLIBCXX_NOEXCEPT : _M_node(__x) { } _Self - _M_const_cast() const + _M_const_cast() const _GLIBCXX_NOEXCEPT { return *this; } // Must downcast from _List_node_base to _List_node to get to _M_data. reference - operator*() const + operator*() const _GLIBCXX_NOEXCEPT { return static_cast<_Node*>(_M_node)->_M_data; } pointer - operator->() const + operator->() const _GLIBCXX_NOEXCEPT { return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); } _Self& - operator++() + operator++() _GLIBCXX_NOEXCEPT { _M_node = _M_node->_M_next; return *this; } _Self - operator++(int) + operator++(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _M_node->_M_next; return __tmp; } _Self& - operator--() + operator--() _GLIBCXX_NOEXCEPT { _M_node = _M_node->_M_prev; return *this; } _Self - operator--(int) + operator--(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _M_node->_M_prev; return __tmp; } bool - operator==(const _Self& __x) const + operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node == __x._M_node; } bool - operator!=(const _Self& __x) const + operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node != __x._M_node; } // The only member points to the %list element. __detail::_List_node_base* _M_node; }; /** * @brief A list::const_iterator. * * All the functions are op overloads. @@ -206,96 +206,97 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef _List_const_iterator<_Tp> _Self; typedef const _List_node<_Tp> _Node; typedef _List_iterator<_Tp> iterator; typedef ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; typedef _Tp value_type; typedef const _Tp* pointer; typedef const _Tp& reference; - _List_const_iterator() + _List_const_iterator() _GLIBCXX_NOEXCEPT : _M_node() { } explicit _List_const_iterator(const __detail::_List_node_base* __x) + _GLIBCXX_NOEXCEPT : _M_node(__x) { } - _List_const_iterator(const iterator& __x) + _List_const_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT : _M_node(__x._M_node) { } iterator - _M_const_cast() const + _M_const_cast() const _GLIBCXX_NOEXCEPT { return iterator(const_cast<__detail::_List_node_base*>(_M_node)); } // Must downcast from List_node_base to _List_node to get to // _M_data. reference - operator*() const + operator*() const _GLIBCXX_NOEXCEPT { return static_cast<_Node*>(_M_node)->_M_data; } pointer - operator->() const + operator->() const _GLIBCXX_NOEXCEPT { return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); } _Self& - operator++() + operator++() _GLIBCXX_NOEXCEPT { _M_node = _M_node->_M_next; return *this; } _Self - operator++(int) + operator++(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _M_node->_M_next; return __tmp; } _Self& - operator--() + operator--() _GLIBCXX_NOEXCEPT { _M_node = _M_node->_M_prev; return *this; } _Self - operator--(int) + operator--(int) _GLIBCXX_NOEXCEPT { _Self __tmp = *this; _M_node = _M_node->_M_prev; return __tmp; } bool - operator==(const _Self& __x) const + operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node == __x._M_node; } bool - operator!=(const _Self& __x) const + operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT { return _M_node != __x._M_node; } // The only member points to the %list element. const __detail::_List_node_base* _M_node; }; template inline bool operator==(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) + const _List_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT { return __x._M_node == __y._M_node; } template inline bool operator!=(const _List_iterator<_Val>& __x, - const _List_const_iterator<_Val>& __y) + const _List_const_iterator<_Val>& __y) _GLIBCXX_NOEXCEPT { return __x._M_node != __y._M_node; } /// See bits/stl_deque.h's _Deque_base for an explanation. template class _List_base { protected: // NOTA BENE // The stored instance is not actually of "allocator_type"'s @@ -317,39 +318,39 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER struct _List_impl : public _Node_alloc_type { __detail::_List_node_base _M_node; _List_impl() : _Node_alloc_type(), _M_node() { } - _List_impl(const _Node_alloc_type& __a) + _List_impl(const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT : _Node_alloc_type(__a), _M_node() { } #if __cplusplus >= 201103L - _List_impl(_Node_alloc_type&& __a) + _List_impl(_Node_alloc_type&& __a) _GLIBCXX_NOEXCEPT : _Node_alloc_type(std::move(__a)), _M_node() { } #endif }; _List_impl _M_impl; _List_node<_Tp>* _M_get_node() { return _M_impl._Node_alloc_type::allocate(1); } void - _M_put_node(_List_node<_Tp>* __p) + _M_put_node(_List_node<_Tp>* __p) _GLIBCXX_NOEXCEPT { _M_impl._Node_alloc_type::deallocate(__p, 1); } public: typedef _Alloc allocator_type; _Node_alloc_type& _M_get_Node_allocator() _GLIBCXX_NOEXCEPT { return *static_cast<_Node_alloc_type*>(&_M_impl); } const _Node_alloc_type& @@ -361,42 +362,42 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _Tp_alloc_type(_M_get_Node_allocator()); } allocator_type get_allocator() const _GLIBCXX_NOEXCEPT { return allocator_type(_M_get_Node_allocator()); } _List_base() : _M_impl() { _M_init(); } - _List_base(const _Node_alloc_type& __a) + _List_base(const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT : _M_impl(__a) { _M_init(); } #if __cplusplus >= 201103L - _List_base(_List_base&& __x) + _List_base(_List_base&& __x) noexcept : _M_impl(std::move(__x._M_get_Node_allocator())) { _M_init(); __detail::_List_node_base::swap(_M_impl._M_node, __x._M_impl._M_node); } #endif // This is what actually destroys the list. ~_List_base() _GLIBCXX_NOEXCEPT { _M_clear(); } void - _M_clear(); + _M_clear() _GLIBCXX_NOEXCEPT; void - _M_init() + _M_init() _GLIBCXX_NOEXCEPT { this->_M_impl._M_node._M_next = &this->_M_impl._M_node; this->_M_impl._M_node._M_prev = &this->_M_impl._M_node; } }; /** * @brief A standard container with linear time access to elements, * and fixed time insertion/deletion at any point in the sequence. * @@ -519,31 +520,25 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER __throw_exception_again; } return __p; } #endif public: // [23.2.2.1] construct/copy/destroy // (assign() and get_allocator() are also listed in this section) /** - * @brief Default constructor creates no elements. - */ - list() - : _Base() { } - - /** * @brief Creates a %list with no elements. * @param __a An allocator object. */ explicit - list(const allocator_type& __a) + list(const allocator_type& __a = allocator_type()) _GLIBCXX_NOEXCEPT : _Base(_Node_alloc_type(__a)) { } #if __cplusplus >= 201103L /** * @brief Creates a %list with default constructed elements. * @param __n The number of elements to initially create. * * This constructor fills the %list with @a __n default * constructed elements. */ @@ -925,49 +920,49 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER void resize(size_type __new_size, value_type __x = value_type()); #endif // element access /** * Returns a read/write reference to the data at the first * element of the %list. */ reference - front() + front() _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read-only (constant) reference to the data at the first * element of the %list. */ const_reference - front() const + front() const _GLIBCXX_NOEXCEPT { return *begin(); } /** * Returns a read/write reference to the data at the last element * of the %list. */ reference - back() + back() _GLIBCXX_NOEXCEPT { iterator __tmp = end(); --__tmp; return *__tmp; } /** * Returns a read-only (constant) reference to the data at the last * element of the %list. */ const_reference - back() const + back() const _GLIBCXX_NOEXCEPT { const_iterator __tmp = end(); --__tmp; return *__tmp; } // [23.2.2.3] modifiers /** * @brief Add data to the front of the %list. * @param __x Data to be added. @@ -999,21 +994,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * This is a typical stack operation. It shrinks the %list by * one. Due to the nature of a %list this operation can be done * in constant time, and only invalidates iterators/references to * the element being removed. * * Note that no data is returned, and if the first element's data * is needed, it should be retrieved before pop_front() is * called. */ void - pop_front() + pop_front() _GLIBCXX_NOEXCEPT { this->_M_erase(begin()); } /** * @brief Add data to the end of the %list. * @param __x Data to be added. * * This is a typical stack operation. The function creates an * element at the end of the %list and assigns the given data to * it. Due to the nature of a %list this operation can be done * in constant time, and does not invalidate iterators and @@ -1039,21 +1034,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * * This is a typical stack operation. It shrinks the %list by * one. Due to the nature of a %list this operation can be done * in constant time, and only invalidates iterators/references to * the element being removed. * * Note that no data is returned, and if the last element's data * is needed, it should be retrieved before pop_back() is called. */ void - pop_back() + pop_back() _GLIBCXX_NOEXCEPT { this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); } #if __cplusplus >= 201103L /** * @brief Constructs object in %list before specified iterator. * @param __position A const_iterator into the %list. * @param __args Arguments. * @return An iterator that points to the inserted data. * * This function will insert an object of type T constructed @@ -1224,21 +1219,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * * Due to the nature of a %list this operation can be done in * constant time, and only invalidates iterators/references to * the element being removed. The user is also cautioned that * this function only erases the element, and that if the element * is itself a pointer, the pointed-to memory is not touched in * any way. Managing the pointer is the user's responsibility. */ iterator #if __cplusplus >= 201103L - erase(const_iterator __position); + erase(const_iterator __position) noexcept; #else erase(iterator __position); #endif /** * @brief Remove a range of elements. * @param __first Iterator pointing to the first element to be erased. * @param __last Iterator pointing to one past the last element to be * erased. * @return An iterator pointing to the element pointed to by @a last @@ -1249,21 +1244,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * * This operation is linear time in the size of the range and only * invalidates iterators/references to the element being removed. * The user is also cautioned that this function only erases the * elements, and that if the elements themselves are pointers, the * pointed-to memory is not touched in any way. Managing the pointer * is the user's responsibility. */ iterator #if __cplusplus >= 201103L - erase(const_iterator __first, const_iterator __last) + erase(const_iterator __first, const_iterator __last) noexcept #else erase(iterator __first, iterator __last) #endif { while (__first != __last) __first = erase(__first); return __last._M_const_cast(); } /** @@ -1680,21 +1675,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER void _M_insert(iterator __position, _Args&&... __args) { _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...); __tmp->_M_hook(__position._M_node); } #endif // Erases element at position given. void - _M_erase(iterator __position) + _M_erase(iterator __position) _GLIBCXX_NOEXCEPT { __position._M_node->_M_unhook(); _Node* __n = static_cast<_Node*>(__position._M_node); #if __cplusplus >= 201103L _M_get_Node_allocator().destroy(__n); #else _M_get_Tp_allocator().destroy(std::__addressof(__n->_M_data)); #endif _M_put_node(__n); } Index: include/debug/list =================================================================== --- include/debug/list (revision 202655) +++ include/debug/list (working copy) @@ -63,21 +63,21 @@ namespace __debug typedef _Tp value_type; typedef _Allocator allocator_type; typedef typename _Base::pointer pointer; typedef typename _Base::const_pointer const_pointer; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; // 23.2.2.1 construct/copy/destroy: explicit - list(const _Allocator& __a = _Allocator()) + list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT : _Base(__a) { } #if __cplusplus >= 201103L explicit list(size_type __n) : _Base(__n) { } list(size_type __n, const _Tp& __value, const _Allocator& __a = _Allocator()) : _Base(__n, __value, __a) { } @@ -313,70 +313,70 @@ namespace __debug __catch(...) { this->_M_revalidate_singular(); __throw_exception_again; } } #endif // element access: reference - front() + front() _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); return _Base::front(); } const_reference - front() const + front() const _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); return _Base::front(); } reference - back() + back() _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); return _Base::back(); } const_reference - back() const + back() const _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); return _Base::back(); } // 23.2.2.3 modifiers: using _Base::push_front; #if __cplusplus >= 201103L using _Base::emplace_front; #endif void - pop_front() + pop_front() _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); this->_M_invalidate_if(_Equal(_Base::begin())); _Base::pop_front(); } using _Base::push_back; #if __cplusplus >= 201103L using _Base::emplace_back; #endif void - pop_back() + pop_back() _GLIBCXX_NOEXCEPT { __glibcxx_check_nonempty(); this->_M_invalidate_if(_Equal(--_Base::end())); _Base::pop_back(); } #if __cplusplus >= 201103L template iterator emplace(const_iterator __position, _Args&&... __args) @@ -448,44 +448,44 @@ namespace __debug { __glibcxx_check_insert_range(__position, __first, __last); _Base::insert(__position.base(), __gnu_debug::__base(__first), __gnu_debug::__base(__last)); } #endif private: _Base_iterator #if __cplusplus >= 201103L - _M_erase(_Base_const_iterator __position) + _M_erase(_Base_const_iterator __position) noexcept #else _M_erase(_Base_iterator __position) #endif { this->_M_invalidate_if(_Equal(__position)); return _Base::erase(__position); } public: iterator #if __cplusplus >= 201103L - erase(const_iterator __position) + erase(const_iterator __position) noexcept #else erase(iterator __position) #endif { __glibcxx_check_erase(__position); return iterator(_M_erase(__position.base()), this); } iterator #if __cplusplus >= 201103L - erase(const_iterator __first, const_iterator __last) + erase(const_iterator __first, const_iterator __last) noexcept #else erase(iterator __first, iterator __last) #endif { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 151. can't currently clear() empty container __glibcxx_check_erase_range(__first, __last); for (_Base_const_iterator __victim = __first.base(); __victim != __last.base(); ++__victim) { Index: include/profile/list =================================================================== --- include/profile/list (revision 202655) +++ include/profile/list (working copy) @@ -58,21 +58,21 @@ template reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; // 23.2.2.1 construct/copy/destroy: explicit - list(const _Allocator& __a = _Allocator()) + list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT : _Base(__a) { __profcxx_list_construct(this); // list2slist __profcxx_list_construct2(this); // list2vector } #if __cplusplus >= 201103L explicit list(size_type __n) : _Base(__n) @@ -269,69 +269,69 @@ template= 201103L using _Base::emplace_front; #endif void - pop_front() + pop_front() _GLIBCXX_NOEXCEPT { __profcxx_list_operation(this); _Base::pop_front(); } using _Base::push_back; #if __cplusplus >= 201103L using _Base::emplace_back; #endif void - pop_back() + pop_back() _GLIBCXX_NOEXCEPT { iterator __victim = end(); --__victim; _Base::pop_back(); __profcxx_list_rewind(this); } #if __cplusplus >= 201103L template iterator @@ -404,29 +404,29 @@ template= 201103L - erase(const_iterator __position) + erase(const_iterator __position) noexcept #else erase(iterator __position) #endif { return iterator(_Base::erase(__position.base()), this); } iterator #if __cplusplus >= 201103L - erase(const_iterator __position, const_iterator __last) + erase(const_iterator __position, const_iterator __last) noexcept #else erase(iterator __position, iterator __last) #endif { // _GLIBCXX_RESOLVE_LIB_DEFECTS // 151. can't currently clear() empty container return iterator(_Base::erase(__position.base(), __last.base()), this); } void Index: testsuite/23_containers/list/requirements/dr438/assign_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/assign_neg.cc (revision 202655) +++ testsuite/23_containers/list/requirements/dr438/assign_neg.cc (working copy) @@ -11,21 +11,21 @@ // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1651 } +// { dg-error "no matching" "" { target *-*-* } 1646 } #include struct A { explicit A(int) { } }; void f() { Index: testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (revision 202655) +++ testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc (working copy) @@ -11,19 +11,19 @@ // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1603 } +// { dg-error "no matching" "" { target *-*-* } 1598 } #include void f() { typedef std::list > list_type; list_type l(10, 1); } Index: testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (revision 202655) +++ testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc (working copy) @@ -11,20 +11,20 @@ // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1603 } +// { dg-error "no matching" "" { target *-*-* } 1598 } #include #include void f() { typedef std::list > > list_type; list_type l('a', 'b'); } Index: testsuite/23_containers/list/requirements/dr438/insert_neg.cc =================================================================== --- testsuite/23_containers/list/requirements/dr438/insert_neg.cc (revision 202655) +++ testsuite/23_containers/list/requirements/dr438/insert_neg.cc (working copy) @@ -11,21 +11,21 @@ // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1603 } +// { dg-error "no matching" "" { target *-*-* } 1598 } #include struct A { explicit A(int) { } }; void f() {