OSDN Git Service

2007-10-16 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Oct 2007 15:20:09 +0000 (15:20 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Oct 2007 15:20:09 +0000 (15:20 +0000)
* include/ext/vstring.h (__versa_string<>::
__versa_string(__versa_string&&),
__versa_string<>::operator=(__versa_string&&,
swap(__versa_string<>&&, __versa_string<>&),
swap(__versa_string<>(&, __versa_string<>&&)): Add.
(__versa_string<>::swap(__versa_string&&)): Adjust for C++0x.
* include/ext/sso_string_base.h
(__sso_string_base(__sso_string_base&&)): Add.
(__sso_string_base()): Use _Alloc_hider(_CharT*).
* include/ext/rc_string_base.h (__rc_string_base(__rc_string_base&&)):
Add.
(__rc_string_base()): Use _Alloc_hider(_CharT*).
* include/ext/vstring_util.h (_Alloc_hider::_Alloc_hider(_CharT*)):
Add.
* testsuite/ext/vstring/moveable.cc: Add.

* include/bits/stl_tree.h (_Rb_tree(_Rb_tree&&)): Add.
* include/bits/stl_map.h (map<>::map(map&&)): Forward to the latter.
* include/bits/stl_set.h (set<>::set(set&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::multimap(multimap&&)):
Likewise.
* include/bits/stl_multiset.h (multiset<>::multiset(multiset&&)):
Likewise.
* include/bits/stl_deque.h (_Deque_base<>::_Deque_base(_Deque_base&&)):
Add.
(deque<>::deque(deque&&)): Forward to the latter.
* include/bits/stl_list.h (_List_base<>::_List_base(_List_base&&)):
Add.
(list<>::list(list&&)): Forward to the latter.
* include/bits/stl_vector.h
(_Vector_base<>::_Vector_base(_Vector_base&&)): Add.
(vector<>::vector(vector&&)): Forward to the latter.
* include/bits/stl_bvector.h
(_Bvector_base<>::_Bvector_base(_Bvector_base&&)): Add.
(vector<bool>::vector(vector&&)): Forward to the latter.

* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error lines.
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129381 138bc75d-0d04-0410-961f-82ee72b054a4

27 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/ext/rc_string_base.h
libstdc++-v3/include/ext/sso_string_base.h
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/ext/vstring_util.h
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/ext/vstring/moveable.cc [new file with mode: 0644]

index c72ab47..d3dced6 100644 (file)
@@ -1,3 +1,66 @@
+2007-10-16  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/ext/vstring.h (__versa_string<>::
+       __versa_string(__versa_string&&),
+       __versa_string<>::operator=(__versa_string&&,
+       swap(__versa_string<>&&, __versa_string<>&),
+       swap(__versa_string<>(&, __versa_string<>&&)): Add.
+       (__versa_string<>::swap(__versa_string&&)): Adjust for C++0x.
+       * include/ext/sso_string_base.h
+       (__sso_string_base(__sso_string_base&&)): Add.
+       (__sso_string_base()): Use _Alloc_hider(_CharT*).
+       * include/ext/rc_string_base.h (__rc_string_base(__rc_string_base&&)):
+       Add.
+       (__rc_string_base()): Use _Alloc_hider(_CharT*).
+       * include/ext/vstring_util.h (_Alloc_hider::_Alloc_hider(_CharT*)):
+       Add.
+       * testsuite/ext/vstring/moveable.cc: Add.
+
+       * include/bits/stl_tree.h (_Rb_tree(_Rb_tree&&)): Add.
+       * include/bits/stl_map.h (map<>::map(map&&)): Forward to the latter.
+       * include/bits/stl_set.h (set<>::set(set&&)): Likewise.
+       * include/bits/stl_multimap.h (multimap<>::multimap(multimap&&)):
+       Likewise.
+       * include/bits/stl_multiset.h (multiset<>::multiset(multiset&&)):
+       Likewise.
+       * include/bits/stl_deque.h (_Deque_base<>::_Deque_base(_Deque_base&&)):
+       Add.
+       (deque<>::deque(deque&&)): Forward to the latter.
+       * include/bits/stl_list.h (_List_base<>::_List_base(_List_base&&)):
+       Add.
+       (list<>::list(list&&)): Forward to the latter.
+       * include/bits/stl_vector.h
+       (_Vector_base<>::_Vector_base(_Vector_base&&)): Add.
+       (vector<>::vector(vector&&)): Forward to the latter.
+       * include/bits/stl_bvector.h
+       (_Bvector_base<>::_Bvector_base(_Bvector_base&&)): Add.
+       (vector<bool>::vector(vector&&)): Forward to the latter.
+
+       * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+       Adjust dg-error lines.
+       * 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.
+
 2007-10-15  Paolo Carlini  <pcarlini@suse.de>
 
        * include/debug/set.h (set<>::cbegin, cend, crbegin, crend): Add.
index a704456..cb99b22 100644 (file)
@@ -416,6 +416,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       _Bvector_base(const allocator_type& __a)
       : _M_impl(__a) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      _Bvector_base(_Bvector_base&& __x)
+      : _M_impl(__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;
+       this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+       __x._M_impl._M_start = _Bit_iterator();
+       __x._M_impl._M_finish = _Bit_iterator();
+       __x._M_impl._M_end_of_storage = 0;
+      }
+#endif
+
       ~_Bvector_base()
       { this->_M_deallocate(); }
 
@@ -515,8 +528,7 @@ template<typename _Alloc>
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
     vector(vector&& __x)
-    : _Base(__x._M_get_Bit_allocator())
-    { this->swap(__x); }
+    : _Base(std::forward<_Base>(__x)) { }
 #endif
 
     template<typename _InputIterator>
index 41cd231..356cff2 100644 (file)
@@ -393,6 +393,21 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       : _M_impl(__a)
       { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      _Deque_base(_Deque_base&& __x)
+      : _M_impl(__x._M_get_Tp_allocator())
+      {
+       _M_initialize_map(0);
+       if (__x._M_impl._M_map)
+         {
+           std::swap(this->_M_impl._M_start, __x._M_impl._M_start);
+           std::swap(this->_M_impl._M_finish, __x._M_impl._M_finish);
+           std::swap(this->_M_impl._M_map, __x._M_impl._M_map);
+           std::swap(this->_M_impl._M_map_size, __x._M_impl._M_map_size);
+         }
+      }
+#endif
+
       ~_Deque_base();
 
     protected:
@@ -736,8 +751,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  The contents of @a x are a valid, but unspecified %deque.
        */
       deque(deque&&  __x)
-      : _Base(__x._M_get_Tp_allocator(), 0)
-      { this->swap(__x); }
+      : _Base(std::forward<_Base>(__x)) { }
 #endif
 
       /**
index 7bdeacb..bb8f930 100644 (file)
@@ -351,6 +351,15 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       : _M_impl(__a)
       { _M_init(); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      _List_base(_List_base&& __x)
+      : _M_impl(__x._M_get_Node_allocator())
+      {
+       _M_init();
+       _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node);      
+      }
+#endif
+
       // This is what actually destroys the list.
       ~_List_base()
       { _M_clear(); }
@@ -521,8 +530,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  The contents of @a x are a valid, but unspecified %list.
        */
       list(list&& __x)
-      : _Base(__x._M_get_Node_allocator())
-      { this->swap(__x); }
+      : _Base(std::forward<_Base>(__x)) { }
 #endif
 
       /**
index 28b396e..bc9d13b 100644 (file)
@@ -186,9 +186,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(__x._M_t.key_comp(),
-            __x._M_t._M_get_Node_allocator())
-      { this->swap(__x); }
+      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
 #endif
 
       /**
index 1c1883a..a280692 100644 (file)
@@ -184,9 +184,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(__x._M_t.key_comp(),
-            __x._M_t._M_get_Node_allocator())
-      { this->swap(__x); }
+      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
 #endif
 
       /**
index 55ec047..60d4d9c 100644 (file)
@@ -197,9 +197,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(__x._M_t.key_comp(),
-            __x._M_t._M_get_Node_allocator())
-      { this->swap(__x); }
+      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
 #endif
 
       /**
index 1d62848..d260156 100644 (file)
@@ -204,9 +204,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(__x._M_t.key_comp(),
-            __x._M_t._M_get_Node_allocator())
-      { this->swap(__x); }
+      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
 #endif
 
       /**
index 1b9743f..2503c03 100644 (file)
@@ -607,6 +607,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          }
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      _Rb_tree(_Rb_tree&& __x);
+#endif
+
       ~_Rb_tree()
       { _M_erase(_M_begin()); }
 
@@ -819,6 +823,30 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
         _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __y)
     { __x.swap(__y); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _Key, typename _Val, typename _KeyOfValue,
+           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())
+    {
+      if (__x._M_root() != 0)
+       {
+         _M_root() = __x._M_root();
+         _M_leftmost() = __x._M_leftmost();
+         _M_rightmost() = __x._M_rightmost();
+         _M_root()->_M_parent = _M_end();
+
+         __x._M_root() = 0;
+         __x._M_leftmost() = __x._M_end();
+         __x._M_rightmost() = __x._M_end();
+
+         this->_M_impl._M_node_count = __x._M_impl._M_node_count;
+         __x._M_impl._M_node_count = 0;
+       }
+    }
+#endif
+
   template<typename _Key, typename _Val, typename _KeyOfValue,
            typename _Compare, typename _Alloc>
     _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
index 745ef79..f48fbdb 100644 (file)
@@ -123,6 +123,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      _Vector_base(_Vector_base&& __x)
+      : _M_impl(__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;
+       this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
+       __x._M_impl._M_start = 0;
+       __x._M_impl._M_finish = 0;
+       __x._M_impl._M_end_of_storage = 0;
+      }
+#endif
+
       ~_Vector_base()
       { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
                      - this->_M_impl._M_start); }
@@ -252,8 +265,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
        *  The contents of @a x are a valid, but unspecified %vector.
        */
       vector(vector&& __x)
-      : _Base(__x._M_get_Tp_allocator())
-      { this->swap(__x); }
+      : _Base(std::forward<_Base>(__x)) { }
 #endif
 
       /**
index 49128aa..81dc7ea 100644 (file)
@@ -301,12 +301,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       { _M_rep()->_M_set_length(__n); }
 
       __rc_string_base()
-      : _M_dataplus(_Alloc(), _S_empty_rep._M_refcopy()) { }
+      : _M_dataplus(_S_empty_rep._M_refcopy()) { }
 
       __rc_string_base(const _Alloc& __a);
 
       __rc_string_base(const __rc_string_base& __rcs);
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      __rc_string_base(__rc_string_base&& __rcs)
+      : _M_dataplus(__rcs._M_get_allocator(), __rcs._M_data())
+      { __rcs._M_data(_S_empty_rep._M_refcopy()); }      
+#endif
+
       __rc_string_base(size_type __n, _CharT __c, const _Alloc& __a);
 
       template<typename _InputIterator>
index 0b576ba..9c8c1bc 100644 (file)
@@ -175,13 +175,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       }
 
       __sso_string_base()
-      : _M_dataplus(_Alloc(), _M_local_data)
+      : _M_dataplus(_M_local_data)
       { _M_set_length(0); }
 
       __sso_string_base(const _Alloc& __a);
 
       __sso_string_base(const __sso_string_base& __rcs);
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      __sso_string_base(__sso_string_base&& __rcs);
+#endif
+
       __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a);
 
       template<typename _InputIterator>
@@ -336,6 +340,30 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
     { _M_construct(__rcs._M_data(), __rcs._M_data() + __rcs._M_length()); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    __sso_string_base<_CharT, _Traits, _Alloc>::
+    __sso_string_base(__sso_string_base&& __rcs)
+    : _M_dataplus(__rcs._M_get_allocator(), _M_local_data)
+    {
+      if (__rcs._M_is_local())
+       {
+         if (__rcs._M_length())
+           traits_type::copy(_M_local_data, __rcs._M_local_data,
+                             _S_local_capacity + 1);
+       }
+      else
+       {
+         _M_data(__rcs._M_data());
+         _M_capacity(__rcs._M_allocated_capacity);
+       }
+
+      _M_length(__rcs._M_length());
+      __rcs._M_length(0);
+      __rcs._M_data(__rcs._M_local_data);
+    }
+#endif
+
   template<typename _CharT, typename _Traits, typename _Alloc>
     __sso_string_base<_CharT, _Traits, _Alloc>::
     __sso_string_base(size_type __n, _CharT __c, const _Alloc& __a)
index 1f1965e..ae441bf 100644 (file)
@@ -146,6 +146,18 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       __versa_string(const __versa_string& __str)
       : __vstring_base(__str) { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  String move constructor.
+       *  @param  str  Source string.
+       *
+       *  The newly-constructed %string contains the exact contents of @a str.
+       *  The contents of @a str are a valid, but unspecified string.
+       */
+      __versa_string(__versa_string&& __str)
+      : __vstring_base(std::forward<__vstring_base>(__str)) { }
+#endif
+
       /**
        *  @brief  Construct string as copy of a substring.
        *  @param  str  Source string.
@@ -230,6 +242,23 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       operator=(const __versa_string& __str) 
       { return this->assign(__str); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      /**
+       *  @brief  String move assignment operator.
+       *  @param  str  Source string.
+       *
+       *  The contents of @a str are moved into this string (without copying).
+       *  @a str is a valid, but unspecified string.
+       */
+      __versa_string&
+      operator=(__versa_string&& __str)
+      {
+       if (this != &__str)
+         this->swap(__str);
+       return *this;
+      }
+#endif
+
       /**
        *  @brief  Copy contents of @a s into this string.
        *  @param  s  Source null-terminated string.
@@ -1279,7 +1308,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
        *  time.
       */
       void
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      swap(__versa_string&& __s)
+#else
       swap(__versa_string& __s)
+#endif
       { this->_M_swap(__s); }
 
       // String operations:
@@ -2154,6 +2187,22 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
         __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
     { __lhs.swap(__rhs); }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+  template<typename _CharT, typename _Traits, typename _Alloc,
+          template <typename, typename, typename> class _Base>
+    inline void
+    swap(__versa_string<_CharT, _Traits, _Alloc, _Base>&& __lhs,
+        __versa_string<_CharT, _Traits, _Alloc, _Base>& __rhs)
+    { __lhs.swap(__rhs); }
+
+  template<typename _CharT, typename _Traits, typename _Alloc,
+          template <typename, typename, typename> class _Base>
+    inline void
+    swap(__versa_string<_CharT, _Traits, _Alloc, _Base>& __lhs,
+        __versa_string<_CharT, _Traits, _Alloc, _Base>&& __rhs)
+    { __lhs.swap(__rhs); }
+#endif
+
 _GLIBCXX_END_NAMESPACE
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
index ab7cf3c..5725e0a 100644 (file)
@@ -46,6 +46,7 @@
 #include <bits/ostream_insert.h>
 #include <bits/stl_iterator.h>
 #include <ext/numeric_traits.h>
+#include <bits/stl_move.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
@@ -91,6 +92,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
         struct _Alloc_hider
        : public _Alloc1
        {
+         _Alloc_hider(_CharT* __ptr)
+         : _Alloc1(), _M_p(__ptr) { }
+
          _Alloc_hider(const _Alloc1& __a, _CharT* __ptr)
          : _Alloc1(__a), _M_p(__ptr) { }
 
index 75b656d..12c510a 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1386 }
+// { dg-error "no matching" "" { target *-*-* } 1400 }
 // { dg-excess-errors "" }
 
 #include <deque>
index f8cdee3..49c1cfd 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1321 }
+// { dg-error "no matching" "" { target *-*-* } 1335 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 5e652c6..58042e1 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1321 }
+// { dg-error "no matching" "" { target *-*-* } 1335 }
 // { dg-excess-errors "" }
 
 #include <deque>
index 67cb8a6..2d00333 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1466 }
+// { dg-error "no matching" "" { target *-*-* } 1480 }
 // { dg-excess-errors "" }
 
 #include <deque>
index e47411e..187b751 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1226 }
+// { dg-error "no matching" "" { target *-*-* } 1234 }
 // { dg-excess-errors "" }
 
 #include <list>
index 69bd5b4..843cb46 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1195 }
+// { dg-error "no matching" "" { target *-*-* } 1203 }
 // { dg-excess-errors "" }
 
 #include <list>
index 49b4f7c..56a8056 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1195 }
+// { dg-error "no matching" "" { target *-*-* } 1203 }
 // { dg-excess-errors "" }
 
 #include <list>
index af21a0c..8c2014d 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1195 }
+// { dg-error "no matching" "" { target *-*-* } 1203 }
 // { dg-excess-errors "" }
 
 #include <list>
index 33c2c04..c5b20cb 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 933 }
+// { dg-error "no matching" "" { target *-*-* } 945 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 846cd04..28e0c4d 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 873 }
+// { dg-error "no matching" "" { target *-*-* } 885 }
 // { dg-excess-errors "" }
 
 #include <vector>
index 8dab6ce..717bbc6 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 873 }
+// { dg-error "no matching" "" { target *-*-* } 885 }
 // { dg-excess-errors "" }
 
 #include <vector>
index b97f222..62b331a 100644 (file)
@@ -19,7 +19,7 @@
 // USA.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 974 }
+// { dg-error "no matching" "" { target *-*-* } 986 }
 // { dg-excess-errors "" }
 
 #include <vector>
diff --git a/libstdc++-v3/testsuite/ext/vstring/moveable.cc b/libstdc++-v3/testsuite/ext/vstring/moveable.cc
new file mode 100644 (file)
index 0000000..7a33145
--- /dev/null
@@ -0,0 +1,71 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2007 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on deque (via swap). If the implementation changed
+// this test may begin to fail.
+
+#include <ext/vstring.h>
+#include <utility>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  __gnu_cxx::__sso_string a,b;
+  a.push_back('1');
+  b = std::move(a);
+  VERIFY( b.size() == 1 && b[0] == '1' && a.size() == 0 );
+
+  __gnu_cxx::__sso_string c(std::move(b));
+  VERIFY( c.size() == 1 && c[0] == '1' );
+  VERIFY( b.size() == 0 );
+}
+
+void test02()
+{
+  bool test __attribute__((unused)) = true;
+
+  __gnu_cxx::__rc_string a,b;
+  a.push_back('1');
+  b = std::move(a);
+  VERIFY( b.size() == 1 && b[0] == '1' && a.size() == 0 );
+
+  __gnu_cxx::__rc_string c(std::move(b));
+  VERIFY( c.size() == 1 && c[0] == '1' );
+  VERIFY( b.size() == 0 );
+}
+
+int main()
+{
+  test01();
+  test02();
+  return 0;
+}