From: François Dumont Date: Wed, 29 Jun 2011 20:11:50 +0000 (+0200) Subject: set.h, [...]: Remove base class default constructor calls. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c2d93dbfaae5ec5a86d903cc1383c2558c0156e;p=gcc.git set.h, [...]: Remove base class default constructor calls. 2011-06-29 François Dumont * include/debug/set.h, unordered_map, multiset.h, forward_list, unordered_set, vector, deque, string, list, multimap.h: Remove base class default constructor calls. * include/debug/map.h: Likewise and cleanup several redefinition of base iterator typedef. From-SVN: r175665 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2d10efd3fde..cd0b2934008 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2011-06-29 François Dumont + + * include/debug/set.h, unordered_map, multiset.h, forward_list, + unordered_set, vector, deque, string, list, multimap.h: Remove + base class default constructor calls. + * include/debug/map.h: Likewise and cleanup several redefinition of + base iterator typedef. + 2011-06-29 Nathan Sidwell * libsupc++/eh_arm.c (__cxa_type_match): Construct address of diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 5b6bdeb544a..08c1cdfd0b4 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -45,7 +45,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::deque<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -98,19 +97,19 @@ namespace __debug { } deque(const deque& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } deque(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ deque(deque&& __x) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } deque(initializer_list __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base() { } + : _Base(__l, __a) { } #endif ~deque() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list index 9f1da5b679f..b74b38a02bc 100644 --- a/libstdc++-v3/include/debug/forward_list +++ b/libstdc++-v3/include/debug/forward_list @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::forward_list<_Tp, _Alloc> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index 44a208bfe52..3931a3d3b68 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -45,7 +45,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::list<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; @@ -100,19 +99,19 @@ namespace __debug list(const list& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } list(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ list(list&& __x) noexcept - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } list(initializer_list __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base() { } + : _Base(__l, __a) { } #endif ~list() _GLIBCXX_NOEXCEPT { } @@ -395,7 +394,7 @@ namespace __debug insert(iterator __p, initializer_list __l) { __glibcxx_check_insert(__p); - _Base::insert(__p, __l); + _Base::insert(__p.base(), __l); } #endif diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 9f80251e3ae..e80c1e3b4b7 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::map<_Key, _Tp, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -61,9 +60,9 @@ namespace __debug typedef typename _Base::reference reference; typedef typename _Base::const_reference const_reference; - typedef __gnu_debug::_Safe_iterator + typedef __gnu_debug::_Safe_iterator<_Base_iterator, map> iterator; - typedef __gnu_debug::_Safe_iterator + typedef __gnu_debug::_Safe_iterator<_Base_const_iterator, map> const_iterator; typedef typename _Base::size_type size_type; @@ -85,24 +84,24 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), - __comp, __a), _Safe_base() { } + __comp, __a) { } map(const map& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } map(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } map(initializer_list __l, const _Compare& __c = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __c, __a), _Safe_base() { } + : _Base(__l, __c, __a) { } #endif ~map() _GLIBCXX_NOEXCEPT { } @@ -206,7 +205,6 @@ namespace __debug std::pair insert(const value_type& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(__x); return std::pair(iterator(__res.first, this), __res.second); @@ -219,7 +217,6 @@ namespace __debug std::pair insert(_Pair&& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(std::forward<_Pair>(__x)); return std::pair(iterator(__res.first, this), @@ -384,7 +381,6 @@ namespace __debug std::pair equal_range(const key_type& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, _Base_iterator> __res = _Base::equal_range(__x); return std::make_pair(iterator(__res.first, this), @@ -394,7 +390,6 @@ namespace __debug std::pair equal_range(const key_type& __x) const { - typedef typename _Base::const_iterator _Base_const_iterator; std::pair<_Base_const_iterator, _Base_const_iterator> __res = _Base::equal_range(__x); return std::make_pair(const_iterator(__res.first, this), @@ -411,7 +406,6 @@ namespace __debug void _M_invalidate_all() { - typedef typename _Base::const_iterator _Base_const_iterator; typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal; this->_M_invalidate_if(_Not_equal(_M_base().end())); } diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index b3c43b8bfa2..cf18d7cc114 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -47,7 +47,6 @@ namespace __debug _Compare, _Allocator> > { typedef _GLIBCXX_STD_C::multimap<_Key, _Tp, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -89,21 +88,21 @@ namespace __debug __comp, __a) { } multimap(const multimap& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } multimap(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } multimap(initializer_list __l, const _Compare& __c = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __c, __a), _Safe_base() { } + : _Base(__l, __c, __a) { } #endif ~multimap() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index ee4c04735dd..9f510000d4d 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -88,21 +87,21 @@ namespace __debug __comp, __a) { } multiset(const multiset& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } multiset(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } multiset(initializer_list __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __comp, __a), _Safe_base() { } + : _Base(__l, __comp, __a) { } #endif ~multiset() _GLIBCXX_NOEXCEPT { } diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index fd6a607d013..9846ec865f9 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -46,7 +46,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::const_iterator _Base_const_iterator; typedef typename _Base::iterator _Base_iterator; @@ -88,21 +87,21 @@ namespace __debug __comp, __a) { } set(const set& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } set(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) noexcept(is_nothrow_copy_constructible<_Compare>::value) - : _Base(std::move(__x)), _Safe_base() + : _Base(std::move(__x)) { this->_M_swap(__x); } set(initializer_list __l, const _Compare& __comp = _Compare(), const allocator_type& __a = allocator_type()) - : _Base(__l, __comp, __a), _Safe_base() { } + : _Base(__l, __comp, __a) { } #endif ~set() _GLIBCXX_NOEXCEPT { } @@ -206,7 +205,6 @@ namespace __debug std::pair insert(value_type&& __x) { - typedef typename _Base::iterator _Base_iterator; std::pair<_Base_iterator, bool> __res = _Base::insert(std::move(__x)); return std::pair(iterator(__res.first, this), diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 9e0ad61bdef..7856b240b86 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -75,12 +75,12 @@ namespace __gnu_debug { } // Provides conversion from a release-mode string to a debug-mode string - basic_string(const _Base& __base) : _Base(__base), _Safe_base() { } + basic_string(const _Base& __base) : _Base(__base) { } // _GLIBCXX_RESOLVE_LIB_DEFECTS // 42. string ctors specify wrong default allocator basic_string(const basic_string& __str) - : _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base() + : _Base(__str, 0, _Base::npos, __str.get_allocator()) { } // _GLIBCXX_RESOLVE_LIB_DEFECTS diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 7a4265c7b0d..4f087b75992 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -89,25 +89,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_map(const unordered_map& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_map(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_map(unordered_map&& __x) noexcept(__and_, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_map(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_map() noexcept { } @@ -381,25 +381,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_multimap(const unordered_multimap& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multimap(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multimap(unordered_multimap&& __x) noexcept(__and_, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_multimap(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_multimap() noexcept { } diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 46dff272bb2..c0b245d95a0 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -89,25 +89,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_set(const unordered_set& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_set(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_set(unordered_set&& __x) noexcept(__and_, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_set(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_set() noexcept { } @@ -370,25 +370,25 @@ namespace __debug : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, __last)), __gnu_debug::__base(__last), __n, - __hf, __eql, __a), _Safe_base() { } + __hf, __eql, __a) { } unordered_multiset(const unordered_multiset& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multiset(const _Base& __x) - : _Base(__x), _Safe_base() { } + : _Base(__x) { } unordered_multiset(unordered_multiset&& __x) noexcept(__and_, is_nothrow_copy_constructible<_Pred>>::value) - : _Base(std::move(__x)), _Safe_base() { } + : _Base(std::move(__x)) { } unordered_multiset(initializer_list __l, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__l, __n, __hf, __eql, __a), _Safe_base() { } + : _Base(__l, __n, __hf, __eql, __a) { } ~unordered_multiset() noexcept { } diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index 1b80974d38c..9d68d007c12 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -47,7 +47,6 @@ namespace __debug public __gnu_debug::_Safe_sequence > { typedef _GLIBCXX_STD_C::vector<_Tp, _Allocator> _Base; - typedef __gnu_debug::_Safe_sequence _Safe_base; typedef typename _Base::iterator _Base_iterator; typedef typename _Base::const_iterator _Base_const_iterator; @@ -102,15 +101,15 @@ namespace __debug { _M_update_guaranteed_capacity(); } vector(const vector& __x) - : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } + : _Base(__x), _M_guaranteed_capacity(__x.size()) { } /// Construction from a release-mode vector vector(const _Base& __x) - : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { } + : _Base(__x), _M_guaranteed_capacity(__x.size()) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ vector(vector&& __x) noexcept - : _Base(std::move(__x)), _Safe_base(), + : _Base(std::move(__x)), _M_guaranteed_capacity(this->size()) { this->_M_swap(__x); @@ -119,7 +118,7 @@ namespace __debug vector(initializer_list __l, const allocator_type& __a = allocator_type()) - : _Base(__l, __a), _Safe_base(), + : _Base(__l, __a), _M_guaranteed_capacity(__l.size()) { } #endif