From: Paolo Carlini Date: Thu, 5 Aug 2010 07:34:08 +0000 (+0000) Subject: move.h (forward): Update to N3092. X-Git-Tag: releases/gcc-4.6.0~5239 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f1fd3469feb271afea5f336a7b9dcfc1df19d44;p=thirdparty%2Fgcc.git move.h (forward): Update to N3092. 2010-08-05 Paolo Carlini * include/bits/move.h (forward): Update to N3092. (identity): Remove (US 92 is NAD). * include/debug/set.h: Fix move constructor to simply use move. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: 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/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. * include/ext/vstring.h: Likewise. * include/bits/stl_list.h: Likewise. * include/bits/stl_map.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/forward_list.h: Likewise. * include/bits/stl_multimap.h: Likewise. * include/bits/unordered_map.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/stl_deque.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/stl_bvector.h: Likewise. * testsuite/20_util/identity/value.cc: Remove * testsuite/20_util/identity/requirements/typedefs.cc: Likewise. * testsuite/20_util/identity/requirements/explicit_instantiation.cc: Likewise. From-SVN: r162898 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ea4c2ebac909..6da10e1c917a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,43 @@ +2010-08-05 Paolo Carlini + + * include/bits/move.h (forward): Update to N3092. + (identity): Remove (US 92 is NAD). + * include/debug/set.h: Fix move constructor to simply use move. + * include/debug/unordered_map: Likewise. + * include/debug/multiset.h: 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/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. + * include/ext/vstring.h: Likewise. + * include/bits/stl_list.h: Likewise. + * include/bits/stl_map.h: Likewise. + * include/bits/stl_set.h: Likewise. + * include/bits/forward_list.h: Likewise. + * include/bits/stl_multimap.h: Likewise. + * include/bits/unordered_map.h: Likewise. + * include/bits/stl_vector.h: Likewise. + * include/bits/stl_deque.h: Likewise. + * include/bits/stl_multiset.h: Likewise. + * include/bits/unordered_set.h: Likewise. + * include/bits/stl_bvector.h: Likewise. + * testsuite/20_util/identity/value.cc: Remove + * testsuite/20_util/identity/requirements/typedefs.cc: Likewise. + * testsuite/20_util/identity/requirements/explicit_instantiation.cc: + Likewise. + 2010-07-27 Paolo Carlini * acinclude.m4 ([GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS]): Fix diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 3708a62c37d3..4fe029d3b2d9 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -452,7 +452,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * @param al An allocator object. */ forward_list(forward_list&& __list, const _Alloc& __al) - : _Base(std::forward<_Base>(__list), __al) + : _Base(std::move(__list), __al) { } /** @@ -523,7 +523,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * %forward_list. */ forward_list(forward_list&& __list) - : _Base(std::forward<_Base>(__list)) { } + : _Base(std::move(__list)) { } /** * @brief Builds a %forward_list from an initializer_list diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h index 09b9c85b07ff..d5243d229be0 100644 --- a/libstdc++-v3/include/bits/move.h +++ b/libstdc++-v3/include/bits/move.h @@ -50,37 +50,17 @@ _GLIBCXX_END_NAMESPACE #include // Brings in std::declval too. _GLIBCXX_BEGIN_NAMESPACE(std) - - /// identity - template - struct identity - { - typedef _Tp type; - }; - - /// forward (as per N2835) - /// Forward lvalues as rvalues. - template - inline typename enable_if::value, _Tp&&>::type - forward(typename std::identity<_Tp>::type& __t) - { return static_cast<_Tp&&>(__t); } - - /// Forward rvalues as rvalues. - template - inline typename enable_if::value, _Tp&&>::type - forward(typename std::identity<_Tp>::type&& __t) - { return static_cast<_Tp&&>(__t); } - - // Forward lvalues as lvalues. - template - inline typename enable_if::value, _Tp>::type - forward(typename std::identity<_Tp>::type __t) - { return __t; } - - // Prevent forwarding rvalues as const lvalues. - template - inline typename enable_if::value, _Tp>::type - forward(typename std::remove_reference<_Tp>::type&& __t) = delete; + + /// forward + template + inline typename + enable_if<((std::is_convertible< + typename std::remove_reference<_Up>::type*, + typename std::remove_reference<_Tp>::type*>::value) + && (!std::is_lvalue_reference<_Tp>::value + || std::is_lvalue_reference<_Up>::value)), _Tp&&>::type + forward(_Up&& __u) + { return static_cast<_Tp&&>(__u); } /** * @brief Move a value. @@ -109,10 +89,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_END_NAMESPACE -#define _GLIBCXX_MOVE(_Tp) std::move(_Tp) +#define _GLIBCXX_MOVE(__val) std::move(__val) #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val) #else -#define _GLIBCXX_MOVE(_Tp) (_Tp) +#define _GLIBCXX_MOVE(__val) (__val) #define _GLIBCXX_FORWARD(_Tp, __val) (__val) #endif diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index db81761ca7dd..c489b447ca15 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -528,7 +528,7 @@ template #ifdef __GXX_EXPERIMENTAL_CXX0X__ vector(vector&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } vector(initializer_list __l, const allocator_type& __a = allocator_type()) diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index d3cd73997e9e..397b6333b5bd 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -839,8 +839,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The newly-created %deque contains the exact contents of @a x. * The contents of @a x are a valid, but unspecified %deque. */ - deque(deque&& __x) - : _Base(std::forward<_Base>(__x)) { } + deque(deque&& __x) + : _Base(std::move(__x)) { } /** * @brief Builds a %deque from an initializer list. diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index d6f9255752fe..2bbb26fb494d 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -569,7 +569,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %list. */ list(list&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } /** * @brief Builds a %list from an initializer_list diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 7f81fab1c642..5d6a98b75b25 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -179,7 +179,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %map. */ map(map&& __x) - : _M_t(std::forward<_Rep_type>(__x._M_t)) { } + : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %map from an initializer_list. diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index e5575bc9f722..82a80f27eb45 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -177,7 +177,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %multimap. */ multimap(multimap&& __x) - : _M_t(std::forward<_Rep_type>(__x._M_t)) { } + : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %multimap from an initializer_list. diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 209e58eb9e80..cfe849bf79ac 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %multiset. */ multiset(multiset&& __x) - : _M_t(std::forward<_Rep_type>(__x._M_t)) { } + : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %multiset from an initializer_list. diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 54321e278ac3..ce5bc6c15f22 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -197,7 +197,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %set. */ set(set&& __x) - : _M_t(std::forward<_Rep_type>(__x._M_t)) { } + : _M_t(std::move(__x._M_t)) { } /** * @brief Builds a %set from an initializer_list. diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index d51578c9e059..147e3f7715be 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -290,7 +290,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) * The contents of @a x are a valid, but unspecified %vector. */ vector(vector&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } /** * @brief Builds a %vector from an initializer list. diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index 80b970c8cf5e..f3a16e0dd01d 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __unordered_map(const __unordered_map& __x) = default; __unordered_map(__unordered_map&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } }; template(__x)) { } + : _Base(std::move(__x)) { } }; template(__x)) { } + : _Base(std::move(__x)) { } unordered_map(initializer_list __l, size_type __n = 10, @@ -340,7 +340,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) unordered_multimap(const unordered_multimap& __x) = default; unordered_multimap(unordered_multimap&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } unordered_multimap(initializer_list __l, size_type __n = 10, diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index 8682f2d72372..f056be57ec08 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __unordered_set(const __unordered_set& __x) = default; __unordered_set(__unordered_set&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } }; template(__x)) { } + : _Base(std::move(__x)) { } }; template(__x)) { } + : _Base(std::move(__x)) { } unordered_set(initializer_list __l, size_type __n = 10, @@ -330,7 +330,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) unordered_multiset(const unordered_multiset& __x) = default; unordered_multiset(unordered_multiset&& __x) - : _Base(std::forward<_Base>(__x)) { } + : _Base(std::move(__x)) { } unordered_multiset(initializer_list __l, size_type __n = 10, diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 31f708a9c9d5..2b54b7d3e16e 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -100,7 +100,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ deque(deque&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } deque(initializer_list __l, diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index c65ed5829f24..b6be96f00d39 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -101,7 +101,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ list(list&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } list(initializer_list __l, diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 24f5ea6c06c3..1254e42257b5 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -92,7 +92,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } map(initializer_list __l, diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index 32a542904067..bf06f78f536b 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -93,7 +93,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } multimap(initializer_list __l, diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index 9f65ba34b282..59cc828ce8e0 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -90,7 +90,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } multiset(initializer_list __l, diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index 2bd3ddfa5dcc..24cfcea64112 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -90,7 +90,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) - : _Base(std::forward(__x)), _Safe_base() + : _Base(std::move(__x)), _Safe_base() { this->_M_swap(__x); } set(initializer_list __l, diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index fe31ffb99ed3..e5152ebd3cdf 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -113,7 +113,7 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ basic_string(basic_string&& __str) - : _Base(std::forward<_Base>(__str)) + : _Base(std::move(__str)) { } basic_string(std::initializer_list<_CharT> __l, @@ -153,7 +153,7 @@ namespace __gnu_debug basic_string& operator=(basic_string&& __str) { - *static_cast<_Base*>(this) = std::forward<_Base>(__str); + *static_cast<_Base*>(this) = std::move(__str); this->_M_invalidate_all(); return *this; } @@ -376,7 +376,7 @@ namespace __gnu_debug basic_string& assign(basic_string&& __x) { - _Base::assign(std::forward<_Base>(__x)); + _Base::assign(std::move(__x)); this->_M_invalidate_all(); return *this; } diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index e4c9fa213c5a..805e42ee75ec 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -93,7 +93,7 @@ namespace __debug : _Base(__x), _Safe_base() { } unordered_map(unordered_map&& __x) - : _Base(std::forward(__x)), _Safe_base() { } + : _Base(std::move(__x)), _Safe_base() { } unordered_map(initializer_list __l, size_type __n = 10, @@ -352,7 +352,7 @@ namespace __debug : _Base(__x), _Safe_base() { } unordered_multimap(unordered_multimap&& __x) - : _Base(std::forward(__x)), _Safe_base() { } + : _Base(std::move(__x)), _Safe_base() { } unordered_multimap(initializer_list __l, size_type __n = 10, diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 2956bb04fc50..80ca806f5aa5 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -93,7 +93,7 @@ namespace __debug : _Base(__x), _Safe_base() { } unordered_set(unordered_set&& __x) - : _Base(std::forward(__x)), _Safe_base() { } + : _Base(std::move(__x)), _Safe_base() { } unordered_set(initializer_list __l, size_type __n = 10, @@ -348,7 +348,7 @@ namespace __debug : _Base(__x), _Safe_base() { } unordered_multiset(unordered_multiset&& __x) - : _Base(std::forward(__x)), _Safe_base() { } + : _Base(std::move(__x)), _Safe_base() { } unordered_multiset(initializer_list __l, size_type __n = 10, diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index c81f956212e7..3d039655c166 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -108,7 +108,7 @@ namespace __debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ vector(vector&& __x) - : _Base(std::forward(__x)), _Safe_base(), + : _Base(std::move(__x)), _Safe_base(), _M_guaranteed_capacity(this->size()) { this->_M_swap(__x); diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h index dffd35a19e3d..fab546dfdf51 100644 --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -155,7 +155,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) * string. */ __versa_string(__versa_string&& __str) - : __vstring_base(std::forward<__vstring_base>(__str)) { } + : __vstring_base(std::move(__str)) { } /** * @brief Construct string from an initializer list. diff --git a/libstdc++-v3/include/profile/deque b/libstdc++-v3/include/profile/deque index 9f8ce70c9dbb..b404d972f8fc 100644 --- a/libstdc++-v3/include/profile/deque +++ b/libstdc++-v3/include/profile/deque @@ -93,7 +93,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ deque(deque&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { } deque(initializer_list __l, diff --git a/libstdc++-v3/include/profile/list b/libstdc++-v3/include/profile/list index e5468c440710..564fc8c16f12 100644 --- a/libstdc++-v3/include/profile/list +++ b/libstdc++-v3/include/profile/list @@ -124,7 +124,7 @@ template > #ifdef __GXX_EXPERIMENTAL_CXX0X__ list(list&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { __profcxx_list_construct(this); __profcxx_list_construct2(this); diff --git a/libstdc++-v3/include/profile/map.h b/libstdc++-v3/include/profile/map.h index 8a3a8e45c8f5..3f668af176c5 100644 --- a/libstdc++-v3/include/profile/map.h +++ b/libstdc++-v3/include/profile/map.h @@ -94,7 +94,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ map(map&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { } map(initializer_list __l, diff --git a/libstdc++-v3/include/profile/multimap.h b/libstdc++-v3/include/profile/multimap.h index d5627ad1d0a0..2897614050cb 100644 --- a/libstdc++-v3/include/profile/multimap.h +++ b/libstdc++-v3/include/profile/multimap.h @@ -84,7 +84,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ multimap(multimap&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { } multimap(initializer_list __l, diff --git a/libstdc++-v3/include/profile/multiset.h b/libstdc++-v3/include/profile/multiset.h index 653ba5b46533..3c113ef88d5b 100644 --- a/libstdc++-v3/include/profile/multiset.h +++ b/libstdc++-v3/include/profile/multiset.h @@ -82,7 +82,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ multiset(multiset&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { } multiset(initializer_list __l, diff --git a/libstdc++-v3/include/profile/set.h b/libstdc++-v3/include/profile/set.h index e2e357339dc1..42acf72699a9 100644 --- a/libstdc++-v3/include/profile/set.h +++ b/libstdc++-v3/include/profile/set.h @@ -82,7 +82,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ set(set&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { } set(initializer_list __l, diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map index 6e832c807352..203ae97ef8d0 100644 --- a/libstdc++-v3/include/profile/unordered_map +++ b/libstdc++-v3/include/profile/unordered_map @@ -104,7 +104,7 @@ namespace __profile } unordered_map(unordered_map&& __x) - : _Base(std::forward<_Base>(__x)) + : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); __profcxx_hashtable_construct2(this); @@ -339,7 +339,7 @@ namespace __profile } unordered_multimap(unordered_multimap&& __x) - : _Base(std::forward<_Base>(__x)) + : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); } diff --git a/libstdc++-v3/include/profile/unordered_set b/libstdc++-v3/include/profile/unordered_set index 453157cf941a..1a8836a7772f 100644 --- a/libstdc++-v3/include/profile/unordered_set +++ b/libstdc++-v3/include/profile/unordered_set @@ -103,7 +103,7 @@ namespace __profile } unordered_set(unordered_set&& __x) - : _Base(std::forward<_Base>(__x)) + : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); __profcxx_hashtable_construct2(this); @@ -328,7 +328,7 @@ namespace __profile } unordered_multiset(unordered_multiset&& __x) - : _Base(std::forward<_Base>(__x)) + : _Base(std::move(__x)) { __profcxx_hashtable_construct(this, _Base::bucket_count()); } diff --git a/libstdc++-v3/include/profile/vector b/libstdc++-v3/include/profile/vector index e6c32a38aec3..1bd4346ec677 100644 --- a/libstdc++-v3/include/profile/vector +++ b/libstdc++-v3/include/profile/vector @@ -137,7 +137,7 @@ namespace __profile #ifdef __GXX_EXPERIMENTAL_CXX0X__ vector(vector&& __x) - : _Base(std::forward(__x)) + : _Base(std::move(__x)) { __profcxx_vector_construct(this, this->capacity()); __profcxx_vector_construct2(this); diff --git a/libstdc++-v3/testsuite/20_util/identity/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/identity/requirements/explicit_instantiation.cc deleted file mode 100644 index 691f81b93871..000000000000 --- a/libstdc++-v3/testsuite/20_util/identity/requirements/explicit_instantiation.cc +++ /dev/null @@ -1,32 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// { dg-do compile } - -// 2007-07-10 Paolo Carlini - -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - - -// NB: This file is for testing utility with NO OTHER INCLUDES. - -#include - -namespace std -{ - typedef short test_type; - template struct decay; -} diff --git a/libstdc++-v3/testsuite/20_util/identity/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/identity/requirements/typedefs.cc deleted file mode 100644 index c170818d9e2c..000000000000 --- a/libstdc++-v3/testsuite/20_util/identity/requirements/typedefs.cc +++ /dev/null @@ -1,33 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2007-07-10 Paolo Carlini -// -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -// -// NB: This file is for testing utility with NO OTHER INCLUDES. - -#include - -// { dg-do compile } - -void test01() -{ - // Check for required typedefs - typedef std::identity test_type; - typedef test_type::type type; -} diff --git a/libstdc++-v3/testsuite/20_util/identity/value.cc b/libstdc++-v3/testsuite/20_util/identity/value.cc deleted file mode 100644 index 80b444bf4359..000000000000 --- a/libstdc++-v3/testsuite/20_util/identity/value.cc +++ /dev/null @@ -1,47 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2007-07-10 Paolo Carlini -// -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include -#include - -void test01() -{ - bool test __attribute__((unused)) = true; - using std::identity; - using std::is_same; - using namespace __gnu_test; - - VERIFY( (is_same::type, int>::value) ); - VERIFY( (is_same::type, int&>::value) ); - VERIFY( (is_same::type, int&&>::value) ); - VERIFY( (is_same::type, int*>::value) ); - VERIFY( (is_same::type, ClassType&&>::value) ); - VERIFY( (is_same::type, ClassType>::value) ); - VERIFY( (is_same::type, int(int)>::value) ); - VERIFY( (is_same::type, void>::value) ); - VERIFY( (is_same::type, const void>::value) ); -} - -int main() -{ - test01(); - return 0; -}