re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)
2013-09-18 Marc Glisse <marc.glisse@inria.fr> 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. From-SVN: r202699
This commit is contained in:
parent
309dc1aaee
commit
837bf5116d
|
@ -1,3 +1,36 @@
|
||||||
|
2013-09-18 Marc Glisse <marc.glisse@inria.fr>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2013-09-17 Marc Glisse <marc.glisse@inria.fr>
|
2013-09-17 Marc Glisse <marc.glisse@inria.fr>
|
||||||
|
|
||||||
PR libstdc++/58338
|
PR libstdc++/58338
|
||||||
|
|
|
@ -63,7 +63,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
template<typename _Tp, typename _Alloc>
|
template<typename _Tp, typename _Alloc>
|
||||||
void
|
void
|
||||||
_List_base<_Tp, _Alloc>::
|
_List_base<_Tp, _Alloc>::
|
||||||
_M_clear()
|
_M_clear() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
typedef _List_node<_Tp> _Node;
|
typedef _List_node<_Tp> _Node;
|
||||||
_Node* __cur = static_cast<_Node*>(_M_impl._M_node._M_next);
|
_Node* __cur = static_cast<_Node*>(_M_impl._M_node._M_next);
|
||||||
|
@ -145,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
typename list<_Tp, _Alloc>::iterator
|
typename list<_Tp, _Alloc>::iterator
|
||||||
list<_Tp, _Alloc>::
|
list<_Tp, _Alloc>::
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __position)
|
erase(const_iterator __position) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __position)
|
erase(iterator __position)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -133,35 +133,35 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
typedef _Tp* pointer;
|
typedef _Tp* pointer;
|
||||||
typedef _Tp& reference;
|
typedef _Tp& reference;
|
||||||
|
|
||||||
_List_iterator()
|
_List_iterator() _GLIBCXX_NOEXCEPT
|
||||||
: _M_node() { }
|
: _M_node() { }
|
||||||
|
|
||||||
explicit
|
explicit
|
||||||
_List_iterator(__detail::_List_node_base* __x)
|
_List_iterator(__detail::_List_node_base* __x) _GLIBCXX_NOEXCEPT
|
||||||
: _M_node(__x) { }
|
: _M_node(__x) { }
|
||||||
|
|
||||||
_Self
|
_Self
|
||||||
_M_const_cast() const
|
_M_const_cast() const _GLIBCXX_NOEXCEPT
|
||||||
{ return *this; }
|
{ return *this; }
|
||||||
|
|
||||||
// Must downcast from _List_node_base to _List_node to get to _M_data.
|
// Must downcast from _List_node_base to _List_node to get to _M_data.
|
||||||
reference
|
reference
|
||||||
operator*() const
|
operator*() const _GLIBCXX_NOEXCEPT
|
||||||
{ return static_cast<_Node*>(_M_node)->_M_data; }
|
{ return static_cast<_Node*>(_M_node)->_M_data; }
|
||||||
|
|
||||||
pointer
|
pointer
|
||||||
operator->() const
|
operator->() const _GLIBCXX_NOEXCEPT
|
||||||
{ return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); }
|
{ return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); }
|
||||||
|
|
||||||
_Self&
|
_Self&
|
||||||
operator++()
|
operator++() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_M_node = _M_node->_M_next;
|
_M_node = _M_node->_M_next;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_Self
|
||||||
operator++(int)
|
operator++(int) _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_Self __tmp = *this;
|
_Self __tmp = *this;
|
||||||
_M_node = _M_node->_M_next;
|
_M_node = _M_node->_M_next;
|
||||||
|
@ -169,14 +169,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self&
|
_Self&
|
||||||
operator--()
|
operator--() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_M_node = _M_node->_M_prev;
|
_M_node = _M_node->_M_prev;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_Self
|
||||||
operator--(int)
|
operator--(int) _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_Self __tmp = *this;
|
_Self __tmp = *this;
|
||||||
_M_node = _M_node->_M_prev;
|
_M_node = _M_node->_M_prev;
|
||||||
|
@ -184,11 +184,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator==(const _Self& __x) const
|
operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_node == __x._M_node; }
|
{ return _M_node == __x._M_node; }
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator!=(const _Self& __x) const
|
operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_node != __x._M_node; }
|
{ return _M_node != __x._M_node; }
|
||||||
|
|
||||||
// The only member points to the %list element.
|
// The only member points to the %list element.
|
||||||
|
@ -213,39 +213,40 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
typedef const _Tp* pointer;
|
typedef const _Tp* pointer;
|
||||||
typedef const _Tp& reference;
|
typedef const _Tp& reference;
|
||||||
|
|
||||||
_List_const_iterator()
|
_List_const_iterator() _GLIBCXX_NOEXCEPT
|
||||||
: _M_node() { }
|
: _M_node() { }
|
||||||
|
|
||||||
explicit
|
explicit
|
||||||
_List_const_iterator(const __detail::_List_node_base* __x)
|
_List_const_iterator(const __detail::_List_node_base* __x)
|
||||||
|
_GLIBCXX_NOEXCEPT
|
||||||
: _M_node(__x) { }
|
: _M_node(__x) { }
|
||||||
|
|
||||||
_List_const_iterator(const iterator& __x)
|
_List_const_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT
|
||||||
: _M_node(__x._M_node) { }
|
: _M_node(__x._M_node) { }
|
||||||
|
|
||||||
iterator
|
iterator
|
||||||
_M_const_cast() const
|
_M_const_cast() const _GLIBCXX_NOEXCEPT
|
||||||
{ return iterator(const_cast<__detail::_List_node_base*>(_M_node)); }
|
{ return iterator(const_cast<__detail::_List_node_base*>(_M_node)); }
|
||||||
|
|
||||||
// Must downcast from List_node_base to _List_node to get to
|
// Must downcast from List_node_base to _List_node to get to
|
||||||
// _M_data.
|
// _M_data.
|
||||||
reference
|
reference
|
||||||
operator*() const
|
operator*() const _GLIBCXX_NOEXCEPT
|
||||||
{ return static_cast<_Node*>(_M_node)->_M_data; }
|
{ return static_cast<_Node*>(_M_node)->_M_data; }
|
||||||
|
|
||||||
pointer
|
pointer
|
||||||
operator->() const
|
operator->() const _GLIBCXX_NOEXCEPT
|
||||||
{ return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); }
|
{ return std::__addressof(static_cast<_Node*>(_M_node)->_M_data); }
|
||||||
|
|
||||||
_Self&
|
_Self&
|
||||||
operator++()
|
operator++() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_M_node = _M_node->_M_next;
|
_M_node = _M_node->_M_next;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_Self
|
||||||
operator++(int)
|
operator++(int) _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_Self __tmp = *this;
|
_Self __tmp = *this;
|
||||||
_M_node = _M_node->_M_next;
|
_M_node = _M_node->_M_next;
|
||||||
|
@ -253,14 +254,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self&
|
_Self&
|
||||||
operator--()
|
operator--() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_M_node = _M_node->_M_prev;
|
_M_node = _M_node->_M_prev;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_Self
|
||||||
operator--(int)
|
operator--(int) _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
_Self __tmp = *this;
|
_Self __tmp = *this;
|
||||||
_M_node = _M_node->_M_prev;
|
_M_node = _M_node->_M_prev;
|
||||||
|
@ -268,11 +269,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator==(const _Self& __x) const
|
operator==(const _Self& __x) const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_node == __x._M_node; }
|
{ return _M_node == __x._M_node; }
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator!=(const _Self& __x) const
|
operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT
|
||||||
{ return _M_node != __x._M_node; }
|
{ return _M_node != __x._M_node; }
|
||||||
|
|
||||||
// The only member points to the %list element.
|
// The only member points to the %list element.
|
||||||
|
@ -282,13 +283,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
template<typename _Val>
|
template<typename _Val>
|
||||||
inline bool
|
inline bool
|
||||||
operator==(const _List_iterator<_Val>& __x,
|
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; }
|
{ return __x._M_node == __y._M_node; }
|
||||||
|
|
||||||
template<typename _Val>
|
template<typename _Val>
|
||||||
inline bool
|
inline bool
|
||||||
operator!=(const _List_iterator<_Val>& __x,
|
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; }
|
{ return __x._M_node != __y._M_node; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,12 +325,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
: _Node_alloc_type(), _M_node()
|
: _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()
|
: _Node_alloc_type(__a), _M_node()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#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()
|
: _Node_alloc_type(std::move(__a)), _M_node()
|
||||||
{ }
|
{ }
|
||||||
#endif
|
#endif
|
||||||
|
@ -342,7 +343,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
{ return _M_impl._Node_alloc_type::allocate(1); }
|
{ return _M_impl._Node_alloc_type::allocate(1); }
|
||||||
|
|
||||||
void
|
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); }
|
{ _M_impl._Node_alloc_type::deallocate(__p, 1); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -368,12 +369,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
: _M_impl()
|
: _M_impl()
|
||||||
{ _M_init(); }
|
{ _M_init(); }
|
||||||
|
|
||||||
_List_base(const _Node_alloc_type& __a)
|
_List_base(const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
|
||||||
: _M_impl(__a)
|
: _M_impl(__a)
|
||||||
{ _M_init(); }
|
{ _M_init(); }
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
_List_base(_List_base&& __x)
|
_List_base(_List_base&& __x) noexcept
|
||||||
: _M_impl(std::move(__x._M_get_Node_allocator()))
|
: _M_impl(std::move(__x._M_get_Node_allocator()))
|
||||||
{
|
{
|
||||||
_M_init();
|
_M_init();
|
||||||
|
@ -386,10 +387,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
{ _M_clear(); }
|
{ _M_clear(); }
|
||||||
|
|
||||||
void
|
void
|
||||||
_M_clear();
|
_M_clear() _GLIBCXX_NOEXCEPT;
|
||||||
|
|
||||||
void
|
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_next = &this->_M_impl._M_node;
|
||||||
this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
|
this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
|
||||||
|
@ -525,18 +526,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
public:
|
public:
|
||||||
// [23.2.2.1] construct/copy/destroy
|
// [23.2.2.1] construct/copy/destroy
|
||||||
// (assign() and get_allocator() are also listed in this section)
|
// (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.
|
* @brief Creates a %list with no elements.
|
||||||
* @param __a An allocator object.
|
* @param __a An allocator object.
|
||||||
*/
|
*/
|
||||||
explicit
|
explicit
|
||||||
list(const allocator_type& __a)
|
list(const allocator_type& __a = allocator_type()) _GLIBCXX_NOEXCEPT
|
||||||
: _Base(_Node_alloc_type(__a)) { }
|
: _Base(_Node_alloc_type(__a)) { }
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
|
@ -932,7 +927,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* element of the %list.
|
* element of the %list.
|
||||||
*/
|
*/
|
||||||
reference
|
reference
|
||||||
front()
|
front() _GLIBCXX_NOEXCEPT
|
||||||
{ return *begin(); }
|
{ return *begin(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -940,7 +935,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* element of the %list.
|
* element of the %list.
|
||||||
*/
|
*/
|
||||||
const_reference
|
const_reference
|
||||||
front() const
|
front() const _GLIBCXX_NOEXCEPT
|
||||||
{ return *begin(); }
|
{ return *begin(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -948,7 +943,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* of the %list.
|
* of the %list.
|
||||||
*/
|
*/
|
||||||
reference
|
reference
|
||||||
back()
|
back() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
iterator __tmp = end();
|
iterator __tmp = end();
|
||||||
--__tmp;
|
--__tmp;
|
||||||
|
@ -960,7 +955,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* element of the %list.
|
* element of the %list.
|
||||||
*/
|
*/
|
||||||
const_reference
|
const_reference
|
||||||
back() const
|
back() const _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
const_iterator __tmp = end();
|
const_iterator __tmp = end();
|
||||||
--__tmp;
|
--__tmp;
|
||||||
|
@ -1006,7 +1001,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* called.
|
* called.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pop_front()
|
pop_front() _GLIBCXX_NOEXCEPT
|
||||||
{ this->_M_erase(begin()); }
|
{ this->_M_erase(begin()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1046,7 +1041,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
* is needed, it should be retrieved before pop_back() is called.
|
* is needed, it should be retrieved before pop_back() is called.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
pop_back()
|
pop_back() _GLIBCXX_NOEXCEPT
|
||||||
{ this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
|
{ this->_M_erase(iterator(this->_M_impl._M_node._M_prev)); }
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
|
@ -1231,7 +1226,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
*/
|
*/
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __position);
|
erase(const_iterator __position) noexcept;
|
||||||
#else
|
#else
|
||||||
erase(iterator __position);
|
erase(iterator __position);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1256,7 +1251,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
*/
|
*/
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __first, const_iterator __last)
|
erase(const_iterator __first, const_iterator __last) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __first, iterator __last)
|
erase(iterator __first, iterator __last)
|
||||||
#endif
|
#endif
|
||||||
|
@ -1687,7 +1682,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
|
|
||||||
// Erases element at position given.
|
// Erases element at position given.
|
||||||
void
|
void
|
||||||
_M_erase(iterator __position)
|
_M_erase(iterator __position) _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__position._M_node->_M_unhook();
|
__position._M_node->_M_unhook();
|
||||||
_Node* __n = static_cast<_Node*>(__position._M_node);
|
_Node* __n = static_cast<_Node*>(__position._M_node);
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace __debug
|
||||||
|
|
||||||
// 23.2.2.1 construct/copy/destroy:
|
// 23.2.2.1 construct/copy/destroy:
|
||||||
explicit
|
explicit
|
||||||
list(const _Allocator& __a = _Allocator())
|
list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
|
||||||
: _Base(__a) { }
|
: _Base(__a) { }
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
|
@ -320,28 +320,28 @@ namespace __debug
|
||||||
|
|
||||||
// element access:
|
// element access:
|
||||||
reference
|
reference
|
||||||
front()
|
front() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
return _Base::front();
|
return _Base::front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_reference
|
const_reference
|
||||||
front() const
|
front() const _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
return _Base::front();
|
return _Base::front();
|
||||||
}
|
}
|
||||||
|
|
||||||
reference
|
reference
|
||||||
back()
|
back() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
return _Base::back();
|
return _Base::back();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_reference
|
const_reference
|
||||||
back() const
|
back() const _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
return _Base::back();
|
return _Base::back();
|
||||||
|
@ -355,7 +355,7 @@ namespace __debug
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
pop_front()
|
pop_front() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
this->_M_invalidate_if(_Equal(_Base::begin()));
|
this->_M_invalidate_if(_Equal(_Base::begin()));
|
||||||
|
@ -369,7 +369,7 @@ namespace __debug
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
pop_back()
|
pop_back() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__glibcxx_check_nonempty();
|
__glibcxx_check_nonempty();
|
||||||
this->_M_invalidate_if(_Equal(--_Base::end()));
|
this->_M_invalidate_if(_Equal(--_Base::end()));
|
||||||
|
@ -455,7 +455,7 @@ namespace __debug
|
||||||
private:
|
private:
|
||||||
_Base_iterator
|
_Base_iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
_M_erase(_Base_const_iterator __position)
|
_M_erase(_Base_const_iterator __position) noexcept
|
||||||
#else
|
#else
|
||||||
_M_erase(_Base_iterator __position)
|
_M_erase(_Base_iterator __position)
|
||||||
#endif
|
#endif
|
||||||
|
@ -467,7 +467,7 @@ namespace __debug
|
||||||
public:
|
public:
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __position)
|
erase(const_iterator __position) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __position)
|
erase(iterator __position)
|
||||||
#endif
|
#endif
|
||||||
|
@ -478,7 +478,7 @@ namespace __debug
|
||||||
|
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __first, const_iterator __last)
|
erase(const_iterator __first, const_iterator __last) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __first, iterator __last)
|
erase(iterator __first, iterator __last)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,7 +65,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
|
|
||||||
// 23.2.2.1 construct/copy/destroy:
|
// 23.2.2.1 construct/copy/destroy:
|
||||||
explicit
|
explicit
|
||||||
list(const _Allocator& __a = _Allocator())
|
list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
|
||||||
: _Base(__a)
|
: _Base(__a)
|
||||||
{
|
{
|
||||||
__profcxx_list_construct(this); // list2slist
|
__profcxx_list_construct(this); // list2slist
|
||||||
|
@ -276,22 +276,22 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
|
|
||||||
// element access:
|
// element access:
|
||||||
reference
|
reference
|
||||||
front()
|
front() _GLIBCXX_NOEXCEPT
|
||||||
{ return _Base::front(); }
|
{ return _Base::front(); }
|
||||||
|
|
||||||
const_reference
|
const_reference
|
||||||
front() const
|
front() const _GLIBCXX_NOEXCEPT
|
||||||
{ return _Base::front(); }
|
{ return _Base::front(); }
|
||||||
|
|
||||||
reference
|
reference
|
||||||
back()
|
back() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__profcxx_list_rewind(this);
|
__profcxx_list_rewind(this);
|
||||||
return _Base::back();
|
return _Base::back();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_reference
|
const_reference
|
||||||
back() const
|
back() const _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__profcxx_list_rewind(this);
|
__profcxx_list_rewind(this);
|
||||||
return _Base::back();
|
return _Base::back();
|
||||||
|
@ -311,7 +311,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
pop_front()
|
pop_front() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
__profcxx_list_operation(this);
|
__profcxx_list_operation(this);
|
||||||
_Base::pop_front();
|
_Base::pop_front();
|
||||||
|
@ -324,7 +324,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
pop_back()
|
pop_back() _GLIBCXX_NOEXCEPT
|
||||||
{
|
{
|
||||||
iterator __victim = end();
|
iterator __victim = end();
|
||||||
--__victim;
|
--__victim;
|
||||||
|
@ -411,7 +411,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
|
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __position)
|
erase(const_iterator __position) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __position)
|
erase(iterator __position)
|
||||||
#endif
|
#endif
|
||||||
|
@ -419,7 +419,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
|
||||||
|
|
||||||
iterator
|
iterator
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L
|
||||||
erase(const_iterator __position, const_iterator __last)
|
erase(const_iterator __position, const_iterator __last) noexcept
|
||||||
#else
|
#else
|
||||||
erase(iterator __position, iterator __last)
|
erase(iterator __position, iterator __last)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
// { dg-error "no matching" "" { target *-*-* } 1651 }
|
// { dg-error "no matching" "" { target *-*-* } 1646 }
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
// { dg-error "no matching" "" { target *-*-* } 1603 }
|
// { dg-error "no matching" "" { target *-*-* } 1598 }
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
// { dg-error "no matching" "" { target *-*-* } 1603 }
|
// { dg-error "no matching" "" { target *-*-* } 1598 }
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
// { dg-error "no matching" "" { target *-*-* } 1603 }
|
// { dg-error "no matching" "" { target *-*-* } 1598 }
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue