diff options
author | glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-25 20:28:12 +0000 |
---|---|---|
committer | glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-25 20:28:12 +0000 |
commit | 7ccd2a7d20d56efd94ddfd2b2d8c0b7f8fddeedc (patch) | |
tree | a5d221343e52f69d052714dac7cf2f8977c62245 /libstdc++-v3/include/debug | |
parent | aa5031a041b19c0f65314d158fae0ff5a7aa174a (diff) | |
download | gcc-7ccd2a7d20d56efd94ddfd2b2d8c0b7f8fddeedc.tar.gz |
2013-09-25 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/58338
* include/bits/forward_list.h (_Fwd_list_node_base::_M_transfer_after):
Mark as noexcept.
(_Fwd_list_iterator) [_Fwd_list_iterator, operator*, operator->,
operator++, operator==, operator!=, _M_next]: Likewise.
(_Fwd_list_const_iterator) [_Fwd_list_const_iterator, operator*,
operator->, operator++, operator==, operator!=, _M_next]: Likewise.
(operator==(const _Fwd_list_iterator&, const _Fwd_list_const_iterator&),
operator!=(const _Fwd_list_iterator&, const _Fwd_list_const_iterator&)):
Likewise.
* include/bits/hashtable_policy.h (_Hash_node_base::_Hash_node_base,
_Hash_node::_M_next, _Node_iterator_base::_Node_iterator_base,
_Node_iterator_base::_M_incr, operator==(const _Node_iterator_base&,
const _Node_iterator_base&), operator!=(const _Node_iterator_base&,
const _Node_iterator_base&)): Likewise.
(_Node_iterator) [_Node_iterator, operator*, operator->, operator++]:
Likewise.
(_Node_const_iterator) [_Node_const_iterator, operator*, operator->,
operator++]: Likewise.
* include/debug/safe_iterator.h (_Safe_iterator) [_Safe_iterator,
operator=, operator*, operator->, operator++, operator--, operator[],
operator+=, operator+, operator-=, operator-, base, operator _Iterator]:
Likewise.
(operator==(const _Safe_iterator&, const _Safe_iterator&),
operator!=(const _Safe_iterator&, const _Safe_iterator&),
operator<(const _Safe_iterator&, const _Safe_iterator&),
operator<=(const _Safe_iterator&, const _Safe_iterator&),
operator>(const _Safe_iterator&, const _Safe_iterator&),
operator>=(const _Safe_iterator&, const _Safe_iterator&),
operator-(const _Safe_iterator&, const _Safe_iterator&),
operator+(difference_type, const _Safe_iterator&)): Likewise.
* include/profile/iterator_tracker.h (__iterator_tracker)
[__iterator_tracker, base, operator _Iterator, operator->, operator++,
operator--, operator=, operator*, operator[], operator+=, operator+,
operator-=, operator-]: Likewise.
(operator==(const __iterator_tracker&, const __iterator_tracker&),
operator!=(const __iterator_tracker&, const __iterator_tracker&),
operator<(const __iterator_tracker&, const __iterator_tracker&),
operator<=(const __iterator_tracker&, const __iterator_tracker&),
operator>(const __iterator_tracker&, const __iterator_tracker&),
operator>=(const __iterator_tracker&, const __iterator_tracker&),
operator-(const __iterator_tracker&, const __iterator_tracker&),
operator+(difference_type, const __iterator_tracker&)): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202924 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r-- | libstdc++-v3/include/debug/safe_iterator.h | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h index a1f7651b1bd..d5adefd0ace 100644 --- a/libstdc++-v3/include/debug/safe_iterator.h +++ b/libstdc++-v3/include/debug/safe_iterator.h @@ -139,7 +139,7 @@ namespace __gnu_debug typedef typename _Traits::pointer pointer; /// @post the iterator is singular and unattached - _Safe_iterator() : _M_current() { } + _Safe_iterator() _GLIBCXX_NOEXCEPT : _M_current() { } /** * @brief Safe iterator construction from an unsafe iterator and @@ -149,6 +149,7 @@ namespace __gnu_debug * @post this is not singular */ _Safe_iterator(const _Iterator& __i, const _Sequence* __seq) + _GLIBCXX_NOEXCEPT : _Safe_iterator_base(__seq, _M_constant()), _M_current(__i) { _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(), @@ -159,7 +160,7 @@ namespace __gnu_debug /** * @brief Copy construction. */ - _Safe_iterator(const _Safe_iterator& __x) + _Safe_iterator(const _Safe_iterator& __x) _GLIBCXX_NOEXCEPT : _Safe_iterator_base(__x, _M_constant()), _M_current(__x._M_current) { // _GLIBCXX_RESOLVE_LIB_DEFECTS @@ -176,7 +177,7 @@ namespace __gnu_debug * @brief Move construction. * @post __x is singular and unattached */ - _Safe_iterator(_Safe_iterator&& __x) : _M_current() + _Safe_iterator(_Safe_iterator&& __x) noexcept : _M_current() { _GLIBCXX_DEBUG_VERIFY(!__x._M_singular() || __x._M_current == _Iterator(), @@ -198,7 +199,7 @@ namespace __gnu_debug const _Safe_iterator<_MutableIterator, typename __gnu_cxx::__enable_if<(std::__are_same<_MutableIterator, typename _Sequence::iterator::iterator_type>::__value), - _Sequence>::__type>& __x) + _Sequence>::__type>& __x) _GLIBCXX_NOEXCEPT : _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base()) { // _GLIBCXX_RESOLVE_LIB_DEFECTS @@ -214,7 +215,7 @@ namespace __gnu_debug * @brief Copy assignment. */ _Safe_iterator& - operator=(const _Safe_iterator& __x) + operator=(const _Safe_iterator& __x) _GLIBCXX_NOEXCEPT { // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 408. Is vector<reverse_iterator<char*> > forbidden? @@ -234,7 +235,7 @@ namespace __gnu_debug * @post __x is singular and unattached */ _Safe_iterator& - operator=(_Safe_iterator&& __x) + operator=(_Safe_iterator&& __x) noexcept { _GLIBCXX_DEBUG_VERIFY(this != &__x, _M_message(__msg_self_move_assign) @@ -257,7 +258,7 @@ namespace __gnu_debug * @pre iterator is dereferenceable */ reference - operator*() const + operator*() const _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(), _M_message(__msg_bad_deref) @@ -271,7 +272,7 @@ namespace __gnu_debug * @todo Make this correct w.r.t. iterators that return proxies */ pointer - operator->() const + operator->() const _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(), _M_message(__msg_bad_deref) @@ -285,7 +286,7 @@ namespace __gnu_debug * @pre iterator is incrementable */ _Safe_iterator& - operator++() + operator++() _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(), _M_message(__msg_bad_inc) @@ -299,7 +300,7 @@ namespace __gnu_debug * @pre iterator is incrementable */ _Safe_iterator - operator++(int) + operator++(int) _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(), _M_message(__msg_bad_inc) @@ -315,7 +316,7 @@ namespace __gnu_debug * @pre iterator is decrementable */ _Safe_iterator& - operator--() + operator--() _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(), _M_message(__msg_bad_dec) @@ -329,7 +330,7 @@ namespace __gnu_debug * @pre iterator is decrementable */ _Safe_iterator - operator--(int) + operator--(int) _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(), _M_message(__msg_bad_dec) @@ -341,7 +342,7 @@ namespace __gnu_debug // ------ Random access iterator requirements ------ reference - operator[](const difference_type& __n) const + operator[](const difference_type& __n) const _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n) && this->_M_can_advance(__n+1), @@ -352,7 +353,7 @@ namespace __gnu_debug } _Safe_iterator& - operator+=(const difference_type& __n) + operator+=(const difference_type& __n) _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n), _M_message(__msg_advance_oob) @@ -362,7 +363,7 @@ namespace __gnu_debug } _Safe_iterator - operator+(const difference_type& __n) const + operator+(const difference_type& __n) const _GLIBCXX_NOEXCEPT { _Safe_iterator __tmp(*this); __tmp += __n; @@ -370,7 +371,7 @@ namespace __gnu_debug } _Safe_iterator& - operator-=(const difference_type& __n) + operator-=(const difference_type& __n) _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(-__n), _M_message(__msg_retreat_oob) @@ -380,7 +381,7 @@ namespace __gnu_debug } _Safe_iterator - operator-(const difference_type& __n) const + operator-(const difference_type& __n) const _GLIBCXX_NOEXCEPT { _Safe_iterator __tmp(*this); __tmp -= __n; @@ -392,13 +393,13 @@ namespace __gnu_debug * @brief Return the underlying iterator */ _Iterator - base() const { return _M_current; } + base() const _GLIBCXX_NOEXCEPT { return _M_current; } /** * @brief Conversion to underlying non-debug iterator to allow * better interaction with non-debug containers. */ - operator _Iterator() const { return _M_current; } + operator _Iterator() const _GLIBCXX_NOEXCEPT { return _M_current; } /** Attach iterator to the given sequence. */ void @@ -482,6 +483,7 @@ namespace __gnu_debug inline bool operator==(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_compare_bad) @@ -498,6 +500,7 @@ namespace __gnu_debug inline bool operator==(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_compare_bad) @@ -514,6 +517,7 @@ namespace __gnu_debug inline bool operator!=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_compare_bad) @@ -530,6 +534,7 @@ namespace __gnu_debug inline bool operator!=(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_compare_bad) @@ -546,6 +551,7 @@ namespace __gnu_debug inline bool operator<(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -562,6 +568,7 @@ namespace __gnu_debug inline bool operator<(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -578,6 +585,7 @@ namespace __gnu_debug inline bool operator<=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -594,6 +602,7 @@ namespace __gnu_debug inline bool operator<=(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -610,6 +619,7 @@ namespace __gnu_debug inline bool operator>(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -626,6 +636,7 @@ namespace __gnu_debug inline bool operator>(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -642,6 +653,7 @@ namespace __gnu_debug inline bool operator>=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -658,6 +670,7 @@ namespace __gnu_debug inline bool operator>=(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_iter_order_bad) @@ -678,6 +691,7 @@ namespace __gnu_debug inline typename _Safe_iterator<_IteratorL, _Sequence>::difference_type operator-(const _Safe_iterator<_IteratorL, _Sequence>& __lhs, const _Safe_iterator<_IteratorR, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_distance_bad) @@ -694,6 +708,7 @@ namespace __gnu_debug inline typename _Safe_iterator<_Iterator, _Sequence>::difference_type operator-(const _Safe_iterator<_Iterator, _Sequence>& __lhs, const _Safe_iterator<_Iterator, _Sequence>& __rhs) + _GLIBCXX_NOEXCEPT { _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(), _M_message(__msg_distance_bad) @@ -709,7 +724,7 @@ namespace __gnu_debug template<typename _Iterator, typename _Sequence> inline _Safe_iterator<_Iterator, _Sequence> operator+(typename _Safe_iterator<_Iterator,_Sequence>::difference_type __n, - const _Safe_iterator<_Iterator, _Sequence>& __i) + const _Safe_iterator<_Iterator, _Sequence>& __i) _GLIBCXX_NOEXCEPT { return __i + __n; } } // namespace __gnu_debug |