Commit d15ac9d9 by Marc Glisse Committed by Marc Glisse

re PR libstdc++/58338 (Add noexcept to functions with a narrow contract)

2013-09-20  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/58338
	* include/bits/allocator.h (__alloc_swap::_S_do_it,
	__shrink_to_fit_aux::_S_do_it): Mark as noexcept.
	* include/bits/basic_string.h (basic_string::_Rep) [_S_empty_rep,
	_M_is_leaked, _M_is_shared, _M_set_leaked, _M_set_sharable,
	_M_set_length_and_sharable, _M_dispose]: Likewise.
	(basic_string::_Alloc_hider::_Alloc_hider): Likewise.
	(basic_string) [_M_data, _M_rep, _M_ibegin, _M_iend, _M_limit,
	_M_disjunct, _M_copy, _M_move, _M_assign, _S_copy_chars, _S_compare,
	_S_empty_rep, shrink_to_fit, operator[] const, front const, back const]:
	Likewise.
	[clear]: Link to PR 56166.
	[swap]: Link to PR 58265.
	* include/bits/stl_deque.h (_Deque_iterator) [_S_buffer_size,
	_Deque_iterator, _M_const_cast, operator*, operator->, operator++,
	operator--, operator+=, operator+, operator-=, operator-, operator[],
	_M_set_node]: Mark as noexcept.
	(operator==(const _Deque_iterator&, const _Deque_iterator&),
	operator!=(const _Deque_iterator&, const _Deque_iterator&),
	operator<(const _Deque_iterator&, const _Deque_iterator&),
	operator>(const _Deque_iterator&, const _Deque_iterator&),
	operator<=(const _Deque_iterator&, const _Deque_iterator&),
	operator>=(const _Deque_iterator&, const _Deque_iterator&),
	operator-(const _Deque_iterator&, const _Deque_iterator&),
	operator+(ptrdiff_t, const _Deque_iterator&)): Likewise.
	(_Deque_base) [_Deque_base(const allocator_type&)]: Add missing call to
	_M_initialize_map.
	[~_Deque_base, _M_deallocate_node, _M_deallocate_map, _M_destroy_nodes]:
	Mark as noexcept.
	(_Deque_base::_Deque_impl) [_Deque_impl(const _Tp_alloc_type&),
	_Deque_impl(_Tp_alloc_type&&)]: Likewise.
	(deque) [_S_buffer_size, operator=(deque&&), shrink_to_fit, operator[],
	front, back, pop_front, pop_back, swap]: Likewise.
	[deque(), deque(const allocator_type&)]: Merge.
	* include/debug/deque (deque) [operator=(deque&&), shrink_to_fit,
	operator[], front, back, pop_front, pop_back, swap]: Mark as noexcept.
	* include/profile/deque (deque) [operator=(deque&&), operator[], front,
	back, pop_front, pop_back, swap]: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust line number.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r202781
parent d20e48b0
2013-09-20 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/58338
* include/bits/allocator.h (__alloc_swap::_S_do_it,
__shrink_to_fit_aux::_S_do_it): Mark as noexcept.
* include/bits/basic_string.h (basic_string::_Rep) [_S_empty_rep,
_M_is_leaked, _M_is_shared, _M_set_leaked, _M_set_sharable,
_M_set_length_and_sharable, _M_dispose]: Likewise.
(basic_string::_Alloc_hider::_Alloc_hider): Likewise.
(basic_string) [_M_data, _M_rep, _M_ibegin, _M_iend, _M_limit,
_M_disjunct, _M_copy, _M_move, _M_assign, _S_copy_chars, _S_compare,
_S_empty_rep, shrink_to_fit, operator[] const, front const, back const]:
Likewise.
[clear]: Link to PR 56166.
[swap]: Link to PR 58265.
* include/bits/stl_deque.h (_Deque_iterator) [_S_buffer_size,
_Deque_iterator, _M_const_cast, operator*, operator->, operator++,
operator--, operator+=, operator+, operator-=, operator-, operator[],
_M_set_node]: Mark as noexcept.
(operator==(const _Deque_iterator&, const _Deque_iterator&),
operator!=(const _Deque_iterator&, const _Deque_iterator&),
operator<(const _Deque_iterator&, const _Deque_iterator&),
operator>(const _Deque_iterator&, const _Deque_iterator&),
operator<=(const _Deque_iterator&, const _Deque_iterator&),
operator>=(const _Deque_iterator&, const _Deque_iterator&),
operator-(const _Deque_iterator&, const _Deque_iterator&),
operator+(ptrdiff_t, const _Deque_iterator&)): Likewise.
(_Deque_base) [_Deque_base(const allocator_type&)]: Add missing call to
_M_initialize_map.
[~_Deque_base, _M_deallocate_node, _M_deallocate_map, _M_destroy_nodes]:
Mark as noexcept.
(_Deque_base::_Deque_impl) [_Deque_impl(const _Tp_alloc_type&),
_Deque_impl(_Tp_alloc_type&&)]: Likewise.
(deque) [_S_buffer_size, operator=(deque&&), shrink_to_fit, operator[],
front, back, pop_front, pop_back, swap]: Likewise.
[deque(), deque(const allocator_type&)]: Merge.
* include/debug/deque (deque) [operator=(deque&&), shrink_to_fit,
operator[], front, back, pop_front, pop_back, swap]: Mark as noexcept.
* include/profile/deque (deque) [operator=(deque&&), operator[], front,
back, pop_front, pop_back, swap]: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust line number.
* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
2013-09-20 Alan Modra <amodra@gmail.com> 2013-09-20 Alan Modra <amodra@gmail.com>
* configure: Regenerate. * configure: Regenerate.
......
...@@ -158,13 +158,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -158,13 +158,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// To implement Option 3 of DR 431. // To implement Option 3 of DR 431.
template<typename _Alloc, bool = __is_empty(_Alloc)> template<typename _Alloc, bool = __is_empty(_Alloc)>
struct __alloc_swap struct __alloc_swap
{ static void _S_do_it(_Alloc&, _Alloc&) { } }; { static void _S_do_it(_Alloc&, _Alloc&) _GLIBCXX_NOEXCEPT { } };
template<typename _Alloc> template<typename _Alloc>
struct __alloc_swap<_Alloc, false> struct __alloc_swap<_Alloc, false>
{ {
static void static void
_S_do_it(_Alloc& __one, _Alloc& __two) _S_do_it(_Alloc& __one, _Alloc& __two) _GLIBCXX_NOEXCEPT
{ {
// Precondition: swappable allocators. // Precondition: swappable allocators.
if (__one != __two) if (__one != __two)
...@@ -194,13 +194,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -194,13 +194,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
= __or_<is_copy_constructible<typename _Tp::value_type>, = __or_<is_copy_constructible<typename _Tp::value_type>,
is_nothrow_move_constructible<typename _Tp::value_type>>::value> is_nothrow_move_constructible<typename _Tp::value_type>>::value>
struct __shrink_to_fit_aux struct __shrink_to_fit_aux
{ static bool _S_do_it(_Tp&) { return false; } }; { static bool _S_do_it(_Tp&) noexcept { return false; } };
template<typename _Tp> template<typename _Tp>
struct __shrink_to_fit_aux<_Tp, true> struct __shrink_to_fit_aux<_Tp, true>
{ {
static bool static bool
_S_do_it(_Tp& __c) _S_do_it(_Tp& __c) noexcept
{ {
__try __try
{ {
......
...@@ -178,7 +178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -178,7 +178,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static size_type _S_empty_rep_storage[]; static size_type _S_empty_rep_storage[];
static _Rep& static _Rep&
_S_empty_rep() _S_empty_rep() _GLIBCXX_NOEXCEPT
{ {
// NB: Mild hack to avoid strict-aliasing warnings. Note that // NB: Mild hack to avoid strict-aliasing warnings. Note that
// _S_empty_rep_storage is never modified and the punning should // _S_empty_rep_storage is never modified and the punning should
...@@ -188,23 +188,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -188,23 +188,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
bool bool
_M_is_leaked() const _M_is_leaked() const _GLIBCXX_NOEXCEPT
{ return this->_M_refcount < 0; } { return this->_M_refcount < 0; }
bool bool
_M_is_shared() const _M_is_shared() const _GLIBCXX_NOEXCEPT
{ return this->_M_refcount > 0; } { return this->_M_refcount > 0; }
void void
_M_set_leaked() _M_set_leaked() _GLIBCXX_NOEXCEPT
{ this->_M_refcount = -1; } { this->_M_refcount = -1; }
void void
_M_set_sharable() _M_set_sharable() _GLIBCXX_NOEXCEPT
{ this->_M_refcount = 0; } { this->_M_refcount = 0; }
void void
_M_set_length_and_sharable(size_type __n) _M_set_length_and_sharable(size_type __n) _GLIBCXX_NOEXCEPT
{ {
#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
if (__builtin_expect(this != &_S_empty_rep(), false)) if (__builtin_expect(this != &_S_empty_rep(), false))
...@@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_create(size_type, size_type, const _Alloc&); _S_create(size_type, size_type, const _Alloc&);
void void
_M_dispose(const _Alloc& __a) _M_dispose(const _Alloc& __a) _GLIBCXX_NOEXCEPT
{ {
#if _GLIBCXX_FULLY_DYNAMIC_STRING == 0 #if _GLIBCXX_FULLY_DYNAMIC_STRING == 0
if (__builtin_expect(this != &_S_empty_rep(), false)) if (__builtin_expect(this != &_S_empty_rep(), false))
...@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Use empty-base optimization: http://www.cantrip.org/emptyopt.html // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
struct _Alloc_hider : _Alloc struct _Alloc_hider : _Alloc
{ {
_Alloc_hider(_CharT* __dat, const _Alloc& __a) _Alloc_hider(_CharT* __dat, const _Alloc& __a) _GLIBCXX_NOEXCEPT
: _Alloc(__a), _M_p(__dat) { } : _Alloc(__a), _M_p(__dat) { }
_CharT* _M_p; // The actual data. _CharT* _M_p; // The actual data.
...@@ -289,25 +289,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -289,25 +289,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
mutable _Alloc_hider _M_dataplus; mutable _Alloc_hider _M_dataplus;
_CharT* _CharT*
_M_data() const _M_data() const _GLIBCXX_NOEXCEPT
{ return _M_dataplus._M_p; } { return _M_dataplus._M_p; }
_CharT* _CharT*
_M_data(_CharT* __p) _M_data(_CharT* __p) _GLIBCXX_NOEXCEPT
{ return (_M_dataplus._M_p = __p); } { return (_M_dataplus._M_p = __p); }
_Rep* _Rep*
_M_rep() const _M_rep() const _GLIBCXX_NOEXCEPT
{ return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); } { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
// For the internal use we have functions similar to `begin'/`end' // For the internal use we have functions similar to `begin'/`end'
// but they do not call _M_leak. // but they do not call _M_leak.
iterator iterator
_M_ibegin() const _M_ibegin() const _GLIBCXX_NOEXCEPT
{ return iterator(_M_data()); } { return iterator(_M_data()); }
iterator iterator
_M_iend() const _M_iend() const _GLIBCXX_NOEXCEPT
{ return iterator(_M_data() + this->size()); } { return iterator(_M_data() + this->size()); }
void void
...@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -334,7 +334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// NB: _M_limit doesn't check for a bad __pos value. // NB: _M_limit doesn't check for a bad __pos value.
size_type size_type
_M_limit(size_type __pos, size_type __off) const _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
{ {
const bool __testoff = __off < this->size() - __pos; const bool __testoff = __off < this->size() - __pos;
return __testoff ? __off : this->size() - __pos; return __testoff ? __off : this->size() - __pos;
...@@ -342,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -342,7 +342,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// True if _Rep and source do not overlap. // True if _Rep and source do not overlap.
bool bool
_M_disjunct(const _CharT* __s) const _M_disjunct(const _CharT* __s) const _GLIBCXX_NOEXCEPT
{ {
return (less<const _CharT*>()(__s, _M_data()) return (less<const _CharT*>()(__s, _M_data())
|| less<const _CharT*>()(_M_data() + this->size(), __s)); || less<const _CharT*>()(_M_data() + this->size(), __s));
...@@ -351,7 +351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -351,7 +351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// When __n = 1 way faster than the general multichar // When __n = 1 way faster than the general multichar
// traits_type::copy/move/assign. // traits_type::copy/move/assign.
static void static void
_M_copy(_CharT* __d, const _CharT* __s, size_type __n) _M_copy(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, *__s); traits_type::assign(*__d, *__s);
...@@ -360,7 +360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -360,7 +360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
static void static void
_M_move(_CharT* __d, const _CharT* __s, size_type __n) _M_move(_CharT* __d, const _CharT* __s, size_type __n) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, *__s); traits_type::assign(*__d, *__s);
...@@ -369,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -369,7 +369,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
static void static void
_M_assign(_CharT* __d, size_type __n, _CharT __c) _M_assign(_CharT* __d, size_type __n, _CharT __c) _GLIBCXX_NOEXCEPT
{ {
if (__n == 1) if (__n == 1)
traits_type::assign(*__d, __c); traits_type::assign(*__d, __c);
...@@ -382,29 +382,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -382,29 +382,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<class _Iterator> template<class _Iterator>
static void static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2) _S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
_GLIBCXX_NOEXCEPT
{ {
for (; __k1 != __k2; ++__k1, ++__p) for (; __k1 != __k2; ++__k1, ++__p)
traits_type::assign(*__p, *__k1); // These types are off. traits_type::assign(*__p, *__k1); // These types are off.
} }
static void static void
_S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
{ _S_copy_chars(__p, __k1.base(), __k2.base()); } { _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void static void
_S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2) _S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
_GLIBCXX_NOEXCEPT
{ _S_copy_chars(__p, __k1.base(), __k2.base()); } { _S_copy_chars(__p, __k1.base(), __k2.base()); }
static void static void
_S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
{ _M_copy(__p, __k1, __k2 - __k1); } { _M_copy(__p, __k1, __k2 - __k1); }
static void static void
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2) _S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
_GLIBCXX_NOEXCEPT
{ _M_copy(__p, __k1, __k2 - __k1); } { _M_copy(__p, __k1, __k2 - __k1); }
static int static int
_S_compare(size_type __n1, size_type __n2) _S_compare(size_type __n1, size_type __n2) _GLIBCXX_NOEXCEPT
{ {
const difference_type __d = difference_type(__n1 - __n2); const difference_type __d = difference_type(__n1 - __n2);
...@@ -423,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -423,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_leak_hard(); _M_leak_hard();
static _Rep& static _Rep&
_S_empty_rep() _S_empty_rep() _GLIBCXX_NOEXCEPT
{ return _Rep::_S_empty_rep(); } { return _Rep::_S_empty_rep(); }
public: public:
...@@ -756,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -756,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
/// A non-binding request to reduce capacity() to size(). /// A non-binding request to reduce capacity() to size().
void void
shrink_to_fit() shrink_to_fit() _GLIBCXX_NOEXCEPT
{ {
if (capacity() > size()) if (capacity() > size())
{ {
...@@ -799,6 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -799,6 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/** /**
* Erases the string, making it empty. * Erases the string, making it empty.
*/ */
// PR 56166: this should not throw.
void void
clear() _GLIBCXX_NOEXCEPT clear() _GLIBCXX_NOEXCEPT
{ _M_mutate(0, this->size(), 0); } { _M_mutate(0, this->size(), 0); }
...@@ -823,7 +827,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -823,7 +827,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* see at().) * see at().)
*/ */
const_reference const_reference
operator[] (size_type __pos) const operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
{ {
_GLIBCXX_DEBUG_ASSERT(__pos <= size()); _GLIBCXX_DEBUG_ASSERT(__pos <= size());
return _M_data()[__pos]; return _M_data()[__pos];
...@@ -903,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -903,7 +907,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* element of the %string. * element of the %string.
*/ */
const_reference const_reference
front() const front() const _GLIBCXX_NOEXCEPT
{ return operator[](0); } { return operator[](0); }
/** /**
...@@ -919,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -919,7 +923,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* last element of the %string. * last element of the %string.
*/ */
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ return operator[](this->size() - 1); } { return operator[](this->size() - 1); }
#endif #endif
...@@ -1787,6 +1791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1787,6 +1791,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* Exchanges the contents of this string with that of @a __s in constant * Exchanges the contents of this string with that of @a __s in constant
* time. * time.
*/ */
// PR 58265, this should be noexcept.
void void
swap(basic_string& __s); swap(basic_string& __s);
......
...@@ -128,7 +128,7 @@ namespace __debug ...@@ -128,7 +128,7 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
deque& deque&
operator=(deque&& __x) operator=(deque&& __x) noexcept
{ {
// NB: DR 1204. // NB: DR 1204.
// NB: DR 675. // NB: DR 675.
...@@ -287,7 +287,7 @@ namespace __debug ...@@ -287,7 +287,7 @@ namespace __debug
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
void void
shrink_to_fit() shrink_to_fit() noexcept
{ {
if (_Base::_M_shrink_to_fit()) if (_Base::_M_shrink_to_fit())
this->_M_invalidate_all(); this->_M_invalidate_all();
...@@ -298,14 +298,14 @@ namespace __debug ...@@ -298,14 +298,14 @@ namespace __debug
// element access: // element access:
reference reference
operator[](size_type __n) operator[](size_type __n) _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_subscript(__n); __glibcxx_check_subscript(__n);
return _M_base()[__n]; return _M_base()[__n];
} }
const_reference const_reference
operator[](size_type __n) const operator[](size_type __n) const _GLIBCXX_NOEXCEPT
{ {
__glibcxx_check_subscript(__n); __glibcxx_check_subscript(__n);
return _M_base()[__n]; return _M_base()[__n];
...@@ -314,28 +314,28 @@ namespace __debug ...@@ -314,28 +314,28 @@ namespace __debug
using _Base::at; using _Base::at;
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();
...@@ -468,7 +468,7 @@ namespace __debug ...@@ -468,7 +468,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()));
...@@ -476,7 +476,7 @@ namespace __debug ...@@ -476,7 +476,7 @@ namespace __debug
} }
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()));
...@@ -556,7 +556,7 @@ namespace __debug ...@@ -556,7 +556,7 @@ namespace __debug
} }
void void
swap(deque& __x) swap(deque& __x) _GLIBCXX_NOEXCEPT
{ {
_Base::swap(__x); _Base::swap(__x);
this->_M_swap(__x); this->_M_swap(__x);
......
...@@ -117,7 +117,7 @@ namespace __profile ...@@ -117,7 +117,7 @@ namespace __profile
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
deque& deque&
operator=(deque&& __x) operator=(deque&& __x) noexcept
{ {
// NB: DR 1204. // NB: DR 1204.
// NB: DR 675. // NB: DR 675.
...@@ -245,13 +245,13 @@ namespace __profile ...@@ -245,13 +245,13 @@ namespace __profile
// element access: // element access:
reference reference
operator[](size_type __n) operator[](size_type __n) _GLIBCXX_NOEXCEPT
{ {
return _M_base()[__n]; return _M_base()[__n];
} }
const_reference const_reference
operator[](size_type __n) const operator[](size_type __n) const _GLIBCXX_NOEXCEPT
{ {
return _M_base()[__n]; return _M_base()[__n];
} }
...@@ -259,25 +259,25 @@ namespace __profile ...@@ -259,25 +259,25 @@ namespace __profile
using _Base::at; using _Base::at;
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
{ {
return _Base::back(); return _Base::back();
} }
const_reference const_reference
back() const back() const _GLIBCXX_NOEXCEPT
{ {
return _Base::back(); return _Base::back();
} }
...@@ -375,13 +375,13 @@ namespace __profile ...@@ -375,13 +375,13 @@ namespace __profile
#endif #endif
void void
pop_front() pop_front() _GLIBCXX_NOEXCEPT
{ {
_Base::pop_front(); _Base::pop_front();
} }
void void
pop_back() pop_back() _GLIBCXX_NOEXCEPT
{ {
_Base::pop_back(); _Base::pop_back();
} }
...@@ -409,7 +409,7 @@ namespace __profile ...@@ -409,7 +409,7 @@ namespace __profile
} }
void void
swap(deque& __x) swap(deque& __x) _GLIBCXX_NOEXCEPT
{ {
_Base::swap(__x); _Base::swap(__x);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -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 *-*-* } 1760 } // { dg-error "no matching" "" { target *-*-* } 1755 }
#include <deque> #include <deque>
......
...@@ -18,7 +18,7 @@ ...@@ -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 *-*-* } 1693 } // { dg-error "no matching" "" { target *-*-* } 1688 }
#include <deque> #include <deque>
......
...@@ -18,7 +18,7 @@ ...@@ -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 *-*-* } 1693 } // { dg-error "no matching" "" { target *-*-* } 1688 }
#include <deque> #include <deque>
#include <utility> #include <utility>
......
...@@ -18,7 +18,7 @@ ...@@ -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 *-*-* } 1844 } // { dg-error "no matching" "" { target *-*-* } 1839 }
#include <deque> #include <deque>
......
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