Commit 7702ab65 by François Dumont

revert: [multiple changes]

2018-10-18  François Dumont  <fdumont@gcc.gnu.org>

	Partial revert.
	2018-10-08  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/list (list<>::cbegin()): Use C++11 direct
	initialization.
	(list<>::cend()): Likewise.
	(list<>::erase(const_iterator, const_iterator)): Ensure consistent
	iterator comparisons.
	(list<>::splice(const_iterator, list&&, const_iterator,
	const_iterator)): Likewise.

	Partial revert.
	2018-10-15  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/vector (vector<>::cbegin()): Use C++11 direct
	initialization.
	(vector<>::cend()): Likewise.
	(vector<>::insert(const_iterator, const _Tp&)): Use consistent
	iterator comparison.
	(vector<>::erase(const_iterator)): Likewise.
	(vector<>::erase(const_iterator, const_iterator)): Likewise.

From-SVN: r265259
parent 7bed4de2
2018-10-18 François Dumont <fdumont@gcc.gnu.org>
Partial revert.
2018-10-08 François Dumont <fdumont@gcc.gnu.org>
* include/debug/list (list<>::cbegin()): Use C++11 direct
initialization.
(list<>::cend()): Likewise.
(list<>::erase(const_iterator, const_iterator)): Ensure consistent
iterator comparisons.
(list<>::splice(const_iterator, list&&, const_iterator,
const_iterator)): Likewise.
Partial revert.
2018-10-15 François Dumont <fdumont@gcc.gnu.org>
* include/debug/vector (vector<>::cbegin()): Use C++11 direct
initialization.
(vector<>::cend()): Likewise.
(vector<>::insert(const_iterator, const _Tp&)): Use consistent
iterator comparison.
(vector<>::erase(const_iterator)): Likewise.
(vector<>::erase(const_iterator, const_iterator)): Likewise.
2018-10-17 Ville Voutilainen <ville.voutilainen@gmail.com> 2018-10-17 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/87619 PR libstdc++/87619
......
...@@ -244,11 +244,11 @@ namespace __debug ...@@ -244,11 +244,11 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
const_iterator const_iterator
cbegin() const noexcept cbegin() const noexcept
{ return { _Base::begin(), this }; } { return const_iterator(_Base::begin(), this); }
const_iterator const_iterator
cend() const noexcept cend() const noexcept
{ return { _Base::end(), this }; } { return const_iterator(_Base::end(), this); }
const_reverse_iterator const_reverse_iterator
crbegin() const noexcept crbegin() const noexcept
...@@ -521,14 +521,13 @@ namespace __debug ...@@ -521,14 +521,13 @@ namespace __debug
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container // 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last); __glibcxx_check_erase_range(__first, __last);
for (__decltype(__first.base()) __victim = __first.base(); for (_Base_const_iterator __victim = __first.base();
__victim != __last.base(); ++__victim) __victim != __last.base(); ++__victim)
{ {
_GLIBCXX_DEBUG_VERIFY( _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
__victim != __first._M_get_sequence()->_M_base().end(), _M_message(__gnu_debug::__msg_valid_range)
_M_message(__gnu_debug::__msg_valid_range) ._M_iterator(__first, "position")
._M_iterator(__first, "position") ._M_iterator(__last, "last"));
._M_iterator(__last, "last"));
this->_M_invalidate_if(_Equal(__victim)); this->_M_invalidate_if(_Equal(__victim));
} }
...@@ -622,14 +621,13 @@ namespace __debug ...@@ -622,14 +621,13 @@ namespace __debug
// We used to perform the splice_alloc check: not anymore, redundant // We used to perform the splice_alloc check: not anymore, redundant
// after implementing the relevant bits of N1599. // after implementing the relevant bits of N1599.
for (__decltype(__first.base()) __tmp = __first.base(); for (_Base_const_iterator __tmp = __first.base();
__tmp != __last.base(); ++__tmp) __tmp != __last.base(); ++__tmp)
{ {
_GLIBCXX_DEBUG_VERIFY( _GLIBCXX_DEBUG_VERIFY(__tmp != _Base::end(),
__tmp != __first._M_get_sequence()->_M_base().end(), _M_message(__gnu_debug::__msg_valid_range)
_M_message(__gnu_debug::__msg_valid_range) ._M_iterator(__first, "first")
._M_iterator(__first, "first") ._M_iterator(__last, "last"));
._M_iterator(__last, "last"));
_GLIBCXX_DEBUG_VERIFY(std::__addressof(__x) != this _GLIBCXX_DEBUG_VERIFY(std::__addressof(__x) != this
|| __tmp != __position.base(), || __tmp != __position.base(),
_M_message(__gnu_debug::__msg_splice_overlap) _M_message(__gnu_debug::__msg_splice_overlap)
......
...@@ -328,11 +328,11 @@ namespace __debug ...@@ -328,11 +328,11 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
const_iterator const_iterator
cbegin() const noexcept cbegin() const noexcept
{ return { _Base::begin(), this }; } { return const_iterator(_Base::begin(), this); }
const_iterator const_iterator
cend() const noexcept cend() const noexcept
{ return { _Base::end(), this }; } { return const_iterator(_Base::end(), this); }
const_reverse_iterator const_reverse_iterator
crbegin() const noexcept crbegin() const noexcept
...@@ -542,8 +542,7 @@ namespace __debug ...@@ -542,8 +542,7 @@ namespace __debug
{ {
__glibcxx_check_insert(__position); __glibcxx_check_insert(__position);
bool __realloc = this->_M_requires_reallocation(this->size() + 1); bool __realloc = this->_M_requires_reallocation(this->size() + 1);
difference_type __offset difference_type __offset = __position.base() - _Base::begin();
= __position.base() - __position._M_get_sequence()->_M_base().begin();
_Base_iterator __res = _Base::insert(__position.base(), __x); _Base_iterator __res = _Base::insert(__position.base(), __x);
if (__realloc) if (__realloc)
this->_M_invalidate_all(); this->_M_invalidate_all();
...@@ -662,8 +661,7 @@ namespace __debug ...@@ -662,8 +661,7 @@ namespace __debug
#endif #endif
{ {
__glibcxx_check_erase(__position); __glibcxx_check_erase(__position);
difference_type __offset difference_type __offset = __position.base() - _Base::begin();
= __position.base() - __position._M_get_sequence()->_M_base().begin();
_Base_iterator __res = _Base::erase(__position.base()); _Base_iterator __res = _Base::erase(__position.base());
this->_M_invalidate_after_nth(__offset); this->_M_invalidate_after_nth(__offset);
return iterator(__res, this); return iterator(__res, this);
...@@ -682,8 +680,7 @@ namespace __debug ...@@ -682,8 +680,7 @@ namespace __debug
if (__first.base() != __last.base()) if (__first.base() != __last.base())
{ {
difference_type __offset = difference_type __offset = __first.base() - _Base::begin();
__first.base() - __first._M_get_sequence()->_M_base().begin();
_Base_iterator __res = _Base::erase(__first.base(), _Base_iterator __res = _Base::erase(__first.base(),
__last.base()); __last.base());
this->_M_invalidate_after_nth(__offset); this->_M_invalidate_after_nth(__offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment