diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-06-01 14:16:19 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-06-01 14:16:19 +0000 |
commit | 6f59ea252b0e75a34e4e3c4ecd92d306addf2da2 (patch) | |
tree | 5f19e059c0bf5df233b925249cc902742f90c284 /libstdc++-v3/include | |
parent | 11026b51231fe541fa4317b550177c004f724ad7 (diff) | |
download | gcc-6f59ea252b0e75a34e4e3c4ecd92d306addf2da2.zip gcc-6f59ea252b0e75a34e4e3c4ecd92d306addf2da2.tar.gz gcc-6f59ea252b0e75a34e4e3c4ecd92d306addf2da2.tar.bz2 |
hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)): Use std::move on the allocator, use noexcept.
2011-06-01 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/hashtable.h (_Hashtable<>::_Hashtable(_Hashtable&&)):
Use std::move on the allocator, use noexcept.
(_Hashtable<>::~_Hashtable): Use noexcept.
* include/bits/stl_list.h: Likewise.
* include/bits/forward_list.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_bvector.h: Likewise.
* include/bits/stl_map.h (map<>::map(map&&)): Use noexcept.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_tree.h (_Rb_tree<>::_Rb_tree(_Rb_tree&&)): Use
std::move on the allocator.
(_Rb_tree<>::~_Rb_tree): Use noexcept.
* include/bits/stl_deque.h: Likewise.
* include/bits/basic_string.h (basic_string<>::~basic_string): Use
noexcept.
* include/ext/vstring.h (__versa_string<>::~__versa_string): Likewise.
* include/debug/set.h: Adjust.
* include/debug/unordered_map: Likewise.
* include/debug/multiset.h: Likewise.
* include/debug/forward_list: Likewise.
* include/debug/vector: Likewise.
* include/debug/unordered_set: Likewise.
* include/debug/deque: Likewise.
* include/debug/map.h: Likewise.
* include/debug/string: Likewise.
* include/debug/list: Likewise.
* include/debug/multimap.h: Likewise.
* include/profile/set.h: Likewise.
* include/profile/unordered_map: Likewise.
* include/profile/multiset.h: Likewise.
* include/profile/forward_list: Likewise.
* include/profile/unordered_set: Likewise.
* include/profile/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/map.h: Likewise.
* include/profile/list: Likewise.
* include/profile/multimap.h: Likewise.
* testsuite/21_strings/basic_string/cons/wchar_t/
noexcept_move_construct.cc: New.
* testsuite/21_strings/basic_string/cons/char/
noexcept_move_construct.cc: Likewise.
* testsuite/ext/vstring/cons/noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/unordered_map/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/multimap/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/set/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/unordered_multimap/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/forward_list/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/unordered_set/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/vector/bool/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/vector/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/multiset/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/list/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/unordered_multiset/cons/
noexcept_move_construct.cc: Likewise.
* testsuite/23_containers/map/cons/noexcept_move_construct.cc
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Adjust dg-error line numbers.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
insert_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
insert_neg.cc: Likewise.
* 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/list/requirements/dr438/
assign_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
insert_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.
* include/bits/move.h (swap): Use __and_ in the noexcept.
* include/bits/algorithmfwd.h: Adjust.
From-SVN: r174525
Diffstat (limited to 'libstdc++-v3/include')
36 files changed, 158 insertions, 79 deletions
diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index fe3b68f..bb7ca25 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -551,8 +551,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void swap(_Tp&, _Tp&) #ifdef __GXX_EXPERIMENTAL_CXX0X__ - noexcept(is_nothrow_move_constructible<_Tp>::value - && is_nothrow_move_assignable<_Tp>::value) + noexcept(__and_<is_nothrow_move_constructible<_Tp>, + is_nothrow_move_assignable<_Tp>>::value) #endif ; diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index f82cfbb..9279a38 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -530,7 +530,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Destroy the string instance. */ - ~basic_string() + ~basic_string() _GLIBCXX_NOEXCEPT { _M_rep()->_M_dispose(this->get_allocator()); } /** diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 1e242f3..df96c88 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -290,6 +290,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _Fwd_list_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_head() { } + + _Fwd_list_impl(_Node_alloc_type&& __a) + : _Node_alloc_type(std::move(__a)), _M_head() + { } }; _Fwd_list_impl _M_impl; @@ -323,7 +327,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER } _Fwd_list_base(_Fwd_list_base&& __lst) - : _M_impl(__lst._M_get_Node_allocator()) + : _M_impl(std::move(__lst._M_get_Node_allocator())) { this->_M_impl._M_head._M_next = __lst._M_impl._M_head._M_next; __lst._M_impl._M_head._M_next = 0; @@ -523,7 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * forward_list. The contents of @a list are a valid, but unspecified * %forward_list. */ - forward_list(forward_list&& __list) + forward_list(forward_list&& __list) noexcept : _Base(std::move(__list)) { } /** @@ -542,7 +546,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER /** * @brief The forward_list dtor. */ - ~forward_list() + ~forward_list() noexcept { } /** diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index fd6bc32..d72c78b 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -213,8 +213,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Hashtable(const _Hashtable&); - _Hashtable(_Hashtable&&); - + _Hashtable(_Hashtable&&) + noexcept(__and_<is_nothrow_copy_constructible<_Equal>, + is_nothrow_copy_constructible<_H1>>::value); + _Hashtable& operator=(const _Hashtable& __ht) { @@ -233,7 +235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } - ~_Hashtable(); + ~_Hashtable() noexcept; void swap(_Hashtable&); @@ -672,11 +674,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: _Hashtable(_Hashtable&& __ht) + noexcept(__and_<is_nothrow_copy_constructible<_Equal>, + is_nothrow_copy_constructible<_H1>>::value) : __detail::_Rehash_base<_RehashPolicy, _Hashtable>(__ht), __detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, __chc>(__ht), __detail::_Map_base<_Key, _Value, _ExtractKey, __uk, _Hashtable>(__ht), - _M_node_allocator(__ht._M_node_allocator), + _M_node_allocator(std::move(__ht._M_node_allocator)), _M_buckets(__ht._M_buckets), _M_bucket_count(__ht._M_bucket_count), _M_begin_bucket_index(__ht._M_begin_bucket_index), @@ -697,7 +701,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool __chc, bool __cit, bool __uk> _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: - ~_Hashtable() + ~_Hashtable() noexcept { clear(); _M_deallocate_buckets(_M_buckets, _M_bucket_count); diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index 963dd4c..ca7686e 100644 --- a/libstdc++-v3/include/bits/move.h +++ b/libstdc++-v3/include/bits/move.h @@ -136,8 +136,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline void swap(_Tp& __a, _Tp& __b) #ifdef __GXX_EXPERIMENTAL_CXX0X__ - noexcept(is_nothrow_move_constructible<_Tp>::value - && is_nothrow_move_assignable<_Tp>::value) + noexcept(__and_<is_nothrow_move_constructible<_Tp>, + is_nothrow_move_assignable<_Tp>>::value) #endif { // concept requirements diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 4715641..edf6629 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -392,6 +392,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _Bvector_impl(const _Bit_alloc_type& __a) : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _Bvector_impl(_Bit_alloc_type&& __a) + : _Bit_alloc_type(std::move(__a)), _M_start(), _M_finish(), + _M_end_of_storage(0) + { } +#endif }; public: @@ -416,8 +423,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER : _M_impl(__a) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - _Bvector_base(_Bvector_base&& __x) - : _M_impl(__x._M_get_Bit_allocator()) + _Bvector_base(_Bvector_base&& __x) noexcept + : _M_impl(std::move(__x._M_get_Bit_allocator())) { this->_M_impl._M_start = __x._M_impl._M_start; this->_M_impl._M_finish = __x._M_impl._M_finish; @@ -532,7 +539,7 @@ template<typename _Alloc> } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - vector(vector&& __x) + vector(vector&& __x) noexcept : _Base(std::move(__x)) { } vector(initializer_list<bool> __l, @@ -553,7 +560,7 @@ template<typename _Alloc> _M_initialize_dispatch(__first, __last, _Integral()); } - ~vector() { } + ~vector() _GLIBCXX_NOEXCEPT { } vector& operator=(const vector& __x) diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 209287b..7ddfbc5 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -465,7 +465,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #ifdef __GXX_EXPERIMENTAL_CXX0X__ _Deque_base(_Deque_base&& __x) - : _M_impl(__x._M_get_Tp_allocator()) + : _M_impl(std::move(__x._M_get_Tp_allocator())) { _M_initialize_map(0); if (__x._M_impl._M_map) @@ -505,6 +505,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER : _Tp_alloc_type(__a), _M_map(0), _M_map_size(0), _M_start(), _M_finish() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _Deque_impl(_Tp_alloc_type&& __a) + : _Tp_alloc_type(std::move(__a)), _M_map(0), _M_map_size(0), + _M_start(), _M_finish() + { } +#endif }; _Tp_alloc_type& @@ -894,7 +901,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * themselves are pointers, the pointed-to memory is not touched in any * way. Managing the pointer is the user's responsibility. */ - ~deque() + ~deque() _GLIBCXX_NOEXCEPT { _M_destroy_data(begin(), end(), _M_get_Tp_allocator()); } /** diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index 5144bb6..9699599 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -318,6 +318,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _List_impl(_Node_alloc_type&& __a) + : _Node_alloc_type(std::move(__a)), _M_node() + { } +#endif }; _List_impl _M_impl; @@ -359,7 +365,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #ifdef __GXX_EXPERIMENTAL_CXX0X__ _List_base(_List_base&& __x) - : _M_impl(__x._M_get_Node_allocator()) + : _M_impl(std::move(__x._M_get_Node_allocator())) { _M_init(); __detail::_List_node_base::swap(this->_M_impl._M_node, @@ -368,7 +374,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif // This is what actually destroys the list. - ~_List_base() + ~_List_base() _GLIBCXX_NOEXCEPT { _M_clear(); } void @@ -580,7 +586,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The newly-created %list contains the exact contents of @a x. * The contents of @a x are a valid, but unspecified %list. */ - list(list&& __x) + list(list&& __x) noexcept : _Base(std::move(__x)) { } /** diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 49341c9..3ca6837 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -181,6 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The contents of @a x are a valid, but unspecified %map. */ map(map&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index bc67726..58811317 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -179,6 +179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The contents of @a x are a valid, but unspecified %multimap. */ multimap(multimap&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index c3e686ad..d5d94eb 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -192,6 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The contents of @a x are a valid, but unspecified %multiset. */ multiset(multiset&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index aa89a8a..9676d90 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -199,6 +199,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The contents of @a x are a valid, but unspecified %set. */ set(set&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _M_t(std::move(__x._M_t)) { } /** diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 7ba6061..3b291c5 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -450,6 +450,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_node_count(0) { _M_initialize(); } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _Rb_tree_impl(const _Key_compare& __comp, _Node_allocator&& __a) + : _Node_allocator(std::move(__a)), _M_key_compare(__comp), + _M_header(), _M_node_count(0) + { _M_initialize(); } +#endif + private: void _M_initialize() @@ -635,7 +642,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Rb_tree(_Rb_tree&& __x); #endif - ~_Rb_tree() + ~_Rb_tree() _GLIBCXX_NOEXCEPT { _M_erase(_M_begin()); } _Rb_tree& @@ -900,7 +907,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typename _Compare, typename _Alloc> _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>:: _Rb_tree(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&& __x) - : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator()) + : _M_impl(__x._M_impl._M_key_compare, + std::move(__x._M_get_Node_allocator())) { if (__x._M_root() != 0) { diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 40770b1..5fa5f52 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -86,6 +86,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _Vector_impl(_Tp_alloc_type const& __a) : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _Vector_impl(_Tp_alloc_type&& __a) + : _Tp_alloc_type(std::move(__a)), + _M_start(0), _M_finish(0), _M_end_of_storage(0) + { } +#endif }; public: @@ -127,7 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #ifdef __GXX_EXPERIMENTAL_CXX0X__ _Vector_base(_Vector_base&& __x) - : _M_impl(__x._M_get_Tp_allocator()) + : _M_impl(std::move(__x._M_get_Tp_allocator())) { this->_M_impl._M_start = __x._M_impl._M_start; this->_M_impl._M_finish = __x._M_impl._M_finish; @@ -291,7 +298,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * The newly-created %vector contains the exact contents of @a x. * The contents of @a x are a valid, but unspecified %vector. */ - vector(vector&& __x) + vector(vector&& __x) noexcept : _Base(std::move(__x)) { } /** @@ -346,7 +353,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * not touched in any way. Managing the pointer is the user's * responsibility. */ - ~vector() + ~vector() _GLIBCXX_NOEXCEPT { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, _M_get_Tp_allocator()); } diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 1756328e..749fc2e 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -113,7 +113,7 @@ namespace __debug : _Base(__l, __a), _Safe_base() { } #endif - ~deque() { } + ~deque() _GLIBCXX_NOEXCEPT { } deque& operator=(const deque& __x) diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list index 8f8d0eb..9f1da5b 100644 --- a/libstdc++-v3/include/debug/forward_list +++ b/libstdc++-v3/include/debug/forward_list @@ -104,7 +104,7 @@ namespace __debug : _Base(__list) { } - forward_list(forward_list&& __list) + forward_list(forward_list&& __list) noexcept : _Base(std::move(__list._M_base())) { this->_M_swap(__list); @@ -115,7 +115,7 @@ namespace __debug : _Base(__il, __al) { } - ~forward_list() + ~forward_list() noexcept { } forward_list& diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index 45c53ff..44a208b 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -106,7 +106,7 @@ namespace __debug : _Base(__x), _Safe_base() { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - list(list&& __x) + list(list&& __x) noexcept : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } @@ -115,7 +115,7 @@ namespace __debug : _Base(__l, __a), _Safe_base() { } #endif - ~list() { } + ~list() _GLIBCXX_NOEXCEPT { } list& operator=(const list& __x) diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 04f8b08..9f80251 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -95,6 +95,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } @@ -104,7 +105,7 @@ namespace __debug : _Base(__l, __c, __a), _Safe_base() { } #endif - ~map() { } + ~map() _GLIBCXX_NOEXCEPT { } map& operator=(const map& __x) diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index 0be2fa3..b3c43b8 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -96,6 +96,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } @@ -105,7 +106,7 @@ namespace __debug : _Base(__l, __c, __a), _Safe_base() { } #endif - ~multimap() { } + ~multimap() _GLIBCXX_NOEXCEPT { } multimap& operator=(const multimap& __x) diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index a9756f5..ee4c047 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -95,6 +95,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } @@ -104,7 +105,7 @@ namespace __debug : _Base(__l, __comp, __a), _Safe_base() { } #endif - ~multiset() { } + ~multiset() _GLIBCXX_NOEXCEPT { } multiset& operator=(const multiset& __x) diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index fddd167..fd6a607 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -1,6 +1,6 @@ // Debugging set implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -95,6 +95,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } @@ -104,7 +105,7 @@ namespace __debug : _Base(__l, __comp, __a), _Safe_base() { } #endif - ~set() { } + ~set() _GLIBCXX_NOEXCEPT { } set& operator=(const set& __x) diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 0af6901..b6d2b4b 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -124,7 +124,7 @@ namespace __gnu_debug { } #endif // __GXX_EXPERIMENTAL_CXX0X__ - ~basic_string() { } + ~basic_string() _GLIBCXX_NOEXCEPT { } basic_string& operator=(const basic_string& __str) diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index b3295fb..7a4265c 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -1,6 +1,6 @@ // Debugging unordered_map/unordered_multimap implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -98,6 +98,8 @@ namespace __debug : _Base(__x), _Safe_base() { } unordered_map(unordered_map&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)), _Safe_base() { } unordered_map(initializer_list<value_type> __l, @@ -107,6 +109,8 @@ namespace __debug const allocator_type& __a = allocator_type()) : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + ~unordered_map() noexcept { } + unordered_map& operator=(const unordered_map& __x) { @@ -385,7 +389,9 @@ namespace __debug unordered_multimap(const _Base& __x) : _Base(__x), _Safe_base() { } - unordered_multimap(unordered_multimap&& __x) + unordered_multimap(unordered_multimap&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)), _Safe_base() { } unordered_multimap(initializer_list<value_type> __l, @@ -395,6 +401,8 @@ namespace __debug const allocator_type& __a = allocator_type()) : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + ~unordered_multimap() noexcept { } + unordered_multimap& operator=(const unordered_multimap& __x) { diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index d67e987..46dff27 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -97,7 +97,9 @@ namespace __debug unordered_set(const _Base& __x) : _Base(__x), _Safe_base() { } - unordered_set(unordered_set&& __x) + unordered_set(unordered_set&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)), _Safe_base() { } unordered_set(initializer_list<value_type> __l, @@ -107,6 +109,8 @@ namespace __debug const allocator_type& __a = allocator_type()) : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + ~unordered_set() noexcept { } + unordered_set& operator=(const unordered_set& __x) { @@ -374,7 +378,9 @@ namespace __debug unordered_multiset(const _Base& __x) : _Base(__x), _Safe_base() { } - unordered_multiset(unordered_multiset&& __x) + unordered_multiset(unordered_multiset&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)), _Safe_base() { } unordered_multiset(initializer_list<value_type> __l, @@ -384,6 +390,8 @@ namespace __debug const allocator_type& __a = allocator_type()) : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + ~unordered_multiset() noexcept { } + unordered_multiset& operator=(const unordered_multiset& __x) { diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index f5bdde4..6072515 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -109,7 +109,7 @@ namespace __debug : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - vector(vector&& __x) + vector(vector&& __x) noexcept : _Base(std::move(__x)), _Safe_base(), _M_guaranteed_capacity(this->size()) { @@ -123,7 +123,7 @@ namespace __debug _M_guaranteed_capacity(__l.size()) { } #endif - ~vector() { } + ~vector() _GLIBCXX_NOEXCEPT { } vector& operator=(const vector& __x) diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index 08e8526..a843368 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -243,7 +243,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Destroy the string instance. */ - ~__versa_string() { } + ~__versa_string() _GLIBCXX_NOEXCEPT { } /** * @brief Assign the value of @a str to this string. diff --git a/libstdc++-v3/include/profile/deque b/libstdc++-v3/include/profile/deque index 564c2dd..48a18c9 100644 --- a/libstdc++-v3/include/profile/deque +++ b/libstdc++-v3/include/profile/deque @@ -101,7 +101,7 @@ namespace __profile : _Base(__l, __a) { } #endif - ~deque() { } + ~deque() _GLIBCXX_NOEXCEPT { } deque& operator=(const deque& __x) diff --git a/libstdc++-v3/include/profile/forward_list b/libstdc++-v3/include/profile/forward_list index 75b59f3..618b248 100644 --- a/libstdc++-v3/include/profile/forward_list +++ b/libstdc++-v3/include/profile/forward_list @@ -83,7 +83,7 @@ namespace __profile : _Base(__list) { } - forward_list(forward_list&& __list) + forward_list(forward_list&& __list) noexcept : _Base(std::move(__list)) { } forward_list(std::initializer_list<_Tp> __il, @@ -91,7 +91,7 @@ namespace __profile : _Base(__il, __al) { } - ~forward_list() + ~forward_list() noexcept { } forward_list& diff --git a/libstdc++-v3/include/profile/list b/libstdc++-v3/include/profile/list index 589f8f5..33b1ae6 100644 --- a/libstdc++-v3/include/profile/list +++ b/libstdc++-v3/include/profile/list @@ -67,7 +67,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > explicit list(const _Allocator& __a = _Allocator()) : _Base(__a) - { + { __profcxx_list_construct(this); // list2slist __profcxx_list_construct2(this); // list2vector } @@ -76,7 +76,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > explicit list(size_type __n) : _Base(__n) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } @@ -84,7 +84,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > list(size_type __n, const _Tp& __value, const _Allocator& __a = _Allocator()) : _Base(__n, __value, __a) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } @@ -93,7 +93,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > list(size_type __n, const _Tp& __value = _Tp(), const _Allocator& __a = _Allocator()) : _Base(__n, __value, __a) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } @@ -103,29 +103,29 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > list(_InputIterator __first, _InputIterator __last, const _Allocator& __a = _Allocator()) : _Base(__first, __last, __a) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } list(const list& __x) : _Base(__x) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } list(const _Base& __x) : _Base(__x) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - list(list&& __x) + list(list&& __x) noexcept : _Base(std::move(__x)) - { + { __profcxx_list_construct(this); __profcxx_list_construct2(this); } @@ -135,7 +135,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> > : _Base(__l, __a) { } #endif - ~list() + ~list() _GLIBCXX_NOEXCEPT { __profcxx_list_destruct(this); __profcxx_list_destruct2(this); diff --git a/libstdc++-v3/include/profile/map.h b/libstdc++-v3/include/profile/map.h index 30f5f3a..622bc57 100644 --- a/libstdc++-v3/include/profile/map.h +++ b/libstdc++-v3/include/profile/map.h @@ -92,6 +92,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)) { } @@ -101,7 +102,7 @@ namespace __profile : _Base(__l, __c, __a) { } #endif - ~map() + ~map() _GLIBCXX_NOEXCEPT { __profcxx_map_to_unordered_map_destruct(this); } map& diff --git a/libstdc++-v3/include/profile/multimap.h b/libstdc++-v3/include/profile/multimap.h index 5f1aba8..547a221 100644 --- a/libstdc++-v3/include/profile/multimap.h +++ b/libstdc++-v3/include/profile/multimap.h @@ -82,6 +82,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)) { } @@ -91,7 +92,7 @@ namespace __profile : _Base(__l, __c, __a) { } #endif - ~multimap() { } + ~multimap() _GLIBCXX_NOEXCEPT { } multimap& operator=(const multimap& __x) diff --git a/libstdc++-v3/include/profile/multiset.h b/libstdc++-v3/include/profile/multiset.h index d140623..a577938 100644 --- a/libstdc++-v3/include/profile/multiset.h +++ b/libstdc++-v3/include/profile/multiset.h @@ -82,6 +82,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)) { } @@ -91,7 +92,7 @@ namespace __profile : _Base(__l, __comp, __a) { } #endif - ~multiset() { } + ~multiset() _GLIBCXX_NOEXCEPT { } multiset& operator=(const multiset& __x) diff --git a/libstdc++-v3/include/profile/set.h b/libstdc++-v3/include/profile/set.h index 8533a48..47261e9 100644 --- a/libstdc++-v3/include/profile/set.h +++ b/libstdc++-v3/include/profile/set.h @@ -82,6 +82,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) + noexcept(is_nothrow_copy_constructible<_Compare>::value) : _Base(std::move(__x)) { } @@ -91,7 +92,7 @@ namespace __profile : _Base(__l, __comp, __a) { } #endif - ~set() { } + ~set() _GLIBCXX_NOEXCEPT { } set& operator=(const set& __x) diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map index 058bbd3..5bbb7ae 100644 --- a/libstdc++-v3/include/profile/unordered_map +++ b/libstdc++-v3/include/profile/unordered_map @@ -104,6 +104,8 @@ namespace __profile } unordered_map(unordered_map&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); @@ -142,7 +144,7 @@ namespace __profile return *this; } - ~unordered_map() + ~unordered_map() noexcept { __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size()); @@ -372,6 +374,8 @@ namespace __profile } unordered_multimap(unordered_multimap&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); @@ -409,7 +413,7 @@ namespace __profile return *this; } - ~unordered_multimap() + ~unordered_multimap() noexcept { __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size()); diff --git a/libstdc++-v3/include/profile/unordered_set b/libstdc++-v3/include/profile/unordered_set index 92c54c1..51b42db 100644 --- a/libstdc++-v3/include/profile/unordered_set +++ b/libstdc++-v3/include/profile/unordered_set @@ -103,6 +103,8 @@ namespace __profile } unordered_set(unordered_set&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); @@ -141,7 +143,7 @@ namespace __profile return *this; } - ~unordered_set() + ~unordered_set() noexcept { __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size()); @@ -346,6 +348,8 @@ namespace __profile } unordered_multiset(unordered_multiset&& __x) + noexcept(__and_<is_nothrow_copy_constructible<_Hash>, + is_nothrow_copy_constructible<_Pred>>::value) : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); @@ -383,7 +387,7 @@ namespace __profile return *this; } - ~unordered_multiset() + ~unordered_multiset() noexcept { __profcxx_hashtable_destruct(this, _Base::bucket_count(), _Base::size()); diff --git a/libstdc++-v3/include/profile/vector b/libstdc++-v3/include/profile/vector index 83a4a3b..7a33e88 100644 --- a/libstdc++-v3/include/profile/vector +++ b/libstdc++-v3/include/profile/vector @@ -79,7 +79,7 @@ namespace __profile explicit vector(const _Allocator& __a = _Allocator()) : _Base(__a) - { + { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); } @@ -87,8 +87,8 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ explicit vector(size_type __n) - : _Base(__n) - { + : _Base(__n) + { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); } @@ -96,7 +96,7 @@ namespace __profile vector(size_type __n, const _Tp& __value, const _Allocator& __a = _Allocator()) : _Base(__n, __value, __a) - { + { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); } @@ -104,8 +104,8 @@ namespace __profile explicit vector(size_type __n, const _Tp& __value = _Tp(), const _Allocator& __a = _Allocator()) - : _Base(__n, __value, __a) - { + : _Base(__n, __value, __a) + { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); } @@ -115,14 +115,14 @@ namespace __profile vector(_InputIterator __first, _InputIterator __last, const _Allocator& __a = _Allocator()) : _Base(__first, __last, __a) - { - __profcxx_vector_construct(this, this->capacity()); - __profcxx_vector_construct2(this); - } + { + __profcxx_vector_construct(this, this->capacity()); + __profcxx_vector_construct2(this); + } vector(const vector& __x) : _Base(__x) - { + { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); } @@ -136,7 +136,7 @@ namespace __profile } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - vector(vector&& __x) + vector(vector&& __x) noexcept : _Base(std::move(__x)) { __profcxx_vector_construct(this, this->capacity()); @@ -148,7 +148,7 @@ namespace __profile : _Base(__l, __a) { } #endif - ~vector() + ~vector() _GLIBCXX_NOEXCEPT { __profcxx_vector_destruct(this, this->capacity(), this->size()); __profcxx_vector_destruct2(this); |