stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signa...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 27 Jun 2013 09:51:21 +0000 (09:51 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 27 Jun 2013 09:51:21 +0000 (09:51 +0000)
2013-06-27  Paolo Carlini  <paolo.carlini@oracle.com>

* include/bits/stl_deque.h (deque<>::insert(iterator,
const value_type&), deque<>::insert(iterator, value_type&&),
deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to
take a const_iterator.
(deque<>::erase): Simplify.
* include/bits/stl_list.h: Likewise.
(_List_iterator<>::_M_const_cast): Add.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_bvector.h: Likewise.
(_Bit_iterator::_M_const_cast): Add.
* include/bits/deque.tcc: Adjust definitions.
* include/bits/list.tcc: Likewise.
* include/bits/vector.tcc: Likewise.
* include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast):
Define trivial version in C++98 mode.
* include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT),
__versa_string<>::replace(iterator, iterator, const __versa_string&),
__versa_string<>::replace(iterator, iterator, const _CharT*,
size_type), __versa_string<>::replace(iterator, iterator,
const _CharT*), __versa_string<>::replace(iterator, iterator,
size_type, _CharT)): Adjust C++11 signatures to take a pair of
const_iterators.
* include/debug/deque: Adjust.
* include/debug/list: Likewise.
* include/debug/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/list: Likewise.
* include/profile/vector: Likewise.
(vector<>::emplace): Add.
* testsuite/util/exception/safety.h: Update.
* testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
New.
* testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
Likewise.
* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/insert/
const_iterator.cc: Likewise.
* testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
Likewise.

* testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/
ext/vstring/modifiers/erase/char/.
* testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/
ext/vstring/modifiers/wchar_t/.
* testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/
ext/vstring/modifiers/pop_back/char/.
* testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to
testsuite/ext/vstring/modifiers/pop_back/wchar_t/.

* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_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.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_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/vector/requirements/dr438/insert_neg.cc:
Likewise.

From-SVN: r200458

48 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/deque.tcc
libstdc++-v3/include/bits/list.tcc
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/vector.tcc
libstdc++-v3/include/debug/deque
libstdc++-v3/include/debug/list
libstdc++-v3/include/debug/vector
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/profile/deque
libstdc++-v3/include/profile/list
libstdc++-v3/include/profile/vector
libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc [new file with mode: 0644]
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/modifiers/emplace/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc [new file with mode: 0644]
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/bool/modifiers/insert/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc [new file with mode: 0644]
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/modifiers/char/54577.cc [deleted file]
libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc [deleted file]
libstdc++-v3/testsuite/ext/vstring/modifiers/erase/char/54577.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/erase/wchar_t/54577.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/char/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/wchar_t/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/54577.cc [deleted file]
libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc [deleted file]
libstdc++-v3/testsuite/util/exception/safety.h

index d37f5546d3f00d8081f6e7ec44fb92a51d108542..682b016f73c2e2940239094f05c2010c0a12d3a0 100644 (file)
@@ -1,3 +1,92 @@
+2013-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/bits/stl_deque.h (deque<>::insert(iterator,
+       const value_type&), deque<>::insert(iterator, value_type&&),
+       deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to
+       take a const_iterator.
+       (deque<>::erase): Simplify.
+       * include/bits/stl_list.h: Likewise.
+       (_List_iterator<>::_M_const_cast): Add.
+       * include/bits/stl_vector.h: Likewise.
+       * include/bits/stl_bvector.h: Likewise.
+       (_Bit_iterator::_M_const_cast): Add.
+       * include/bits/deque.tcc: Adjust definitions.
+       * include/bits/list.tcc: Likewise.
+       * include/bits/vector.tcc: Likewise.
+       * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast):
+       Define trivial version in C++98 mode.
+       * include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT),
+       __versa_string<>::replace(iterator, iterator, const __versa_string&),
+       __versa_string<>::replace(iterator, iterator, const _CharT*,
+       size_type), __versa_string<>::replace(iterator, iterator,
+       const _CharT*), __versa_string<>::replace(iterator, iterator,
+       size_type, _CharT)): Adjust C++11 signatures to take a pair of
+       const_iterators.
+       * include/debug/deque: Adjust.
+       * include/debug/list: Likewise.
+       * include/debug/vector: Likewise.
+       * include/profile/deque: Likewise.
+       * include/profile/list: Likewise.
+       * include/profile/vector: Likewise.
+       (vector<>::emplace): Add.
+       * testsuite/util/exception/safety.h: Update.
+       * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
+       New.
+       * testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
+       Likewise.
+       * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
+       Likewise.
+       * testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
+       Likewise.
+       * testsuite/23_containers/vector/bool/modifiers/insert/
+       const_iterator.cc: Likewise.
+       * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
+       Likewise.
+       * testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
+       Likewise.
+       * testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
+       Likewise.
+       * testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
+       Likewise.
+       * testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
+       Likewise.
+       * testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
+       Likewise.
+
+       * testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/
+       ext/vstring/modifiers/erase/char/.
+       * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/
+       ext/vstring/modifiers/wchar_t/.
+       * testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/
+       ext/vstring/modifiers/pop_back/char/.
+       * testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to
+       testsuite/ext/vstring/modifiers/pop_back/wchar_t/.
+
+       * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+       Adjust dg-error line number.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_1_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/
+       constructor_2_neg.cc: Likewise.
+       * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/list/requirements/dr438/assign_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.
+       * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+       Likewise.
+       * testsuite/23_containers/vector/requirements/dr438/assign_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/vector/requirements/dr438/insert_neg.cc:
+       Likewise.
+
 2013-06-25  Ed Smith-Rowland  <3dw4rd@verizon.net>
 
        Status page for C++2014 library features
index 8da73589869297a3528d96974a48a1cc25d7cea5..9c33ad9b0dda528ba5cd978ec3cecbb72b95ed9c 100644 (file)
@@ -143,33 +143,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       }
 #endif
 
-  template <typename _Tp, typename _Alloc>
-    typename deque<_Tp, _Alloc>::iterator
-    deque<_Tp, _Alloc>::
-    insert(iterator __position, const value_type& __x)
-    {
-      if (__position._M_cur == this->_M_impl._M_start._M_cur)
-       {
-         push_front(__x);
-         return this->_M_impl._M_start;
-       }
-      else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
-       {
-         push_back(__x);
-         iterator __tmp = this->_M_impl._M_finish;
-         --__tmp;
-         return __tmp;
-       }
-      else
-        return _M_insert_aux(__position, __x);
-    }
-
 #if __cplusplus >= 201103L
   template<typename _Tp, typename _Alloc>
     template<typename... _Args>
       typename deque<_Tp, _Alloc>::iterator
       deque<_Tp, _Alloc>::
-      emplace(iterator __position, _Args&&... __args)
+      emplace(const_iterator __position, _Args&&... __args)
       {
        if (__position._M_cur == this->_M_impl._M_start._M_cur)
          {
@@ -184,10 +163,36 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
            return __tmp;
          }
        else
-         return _M_insert_aux(__position, std::forward<_Args>(__args)...);
+         return _M_insert_aux(__position._M_const_cast(),
+                              std::forward<_Args>(__args)...);
       }
 #endif
 
+  template <typename _Tp, typename _Alloc>
+    typename deque<_Tp, _Alloc>::iterator
+    deque<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const value_type& __x)
+#else
+    insert(iterator __position, const value_type& __x)
+#endif
+    {
+      if (__position._M_cur == this->_M_impl._M_start._M_cur)
+       {
+         push_front(__x);
+         return this->_M_impl._M_start;
+       }
+      else if (__position._M_cur == this->_M_impl._M_finish._M_cur)
+       {
+         push_back(__x);
+         iterator __tmp = this->_M_impl._M_finish;
+         --__tmp;
+         return __tmp;
+       }
+      else
+       return _M_insert_aux(__position._M_const_cast(), __x);
+   }
+
   template <typename _Tp, typename _Alloc>
     typename deque<_Tp, _Alloc>::iterator
     deque<_Tp, _Alloc>::
index 9fc43cfe68ab9ea94258d997cb7c22cbff6c4c6f..4f82e35c921d0602adf74b2b9748b2e2cfba16a2 100644 (file)
@@ -85,10 +85,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     template<typename... _Args>
       typename list<_Tp, _Alloc>::iterator
       list<_Tp, _Alloc>::
-      emplace(iterator __position, _Args&&... __args)
+      emplace(const_iterator __position, _Args&&... __args)
       {
        _Node* __tmp = _M_create_node(std::forward<_Args>(__args)...);
-       __tmp->_M_hook(__position._M_node);
+       __tmp->_M_hook(__position._M_const_cast()._M_node);
        return iterator(__tmp);
       }
 #endif
@@ -96,10 +96,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
   template<typename _Tp, typename _Alloc>
     typename list<_Tp, _Alloc>::iterator
     list<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const value_type& __x)
+#else
     insert(iterator __position, const value_type& __x)
+#endif
     {
       _Node* __tmp = _M_create_node(__x);
-      __tmp->_M_hook(__position._M_node);
+      __tmp->_M_hook(__position._M_const_cast()._M_node);
       return iterator(__tmp);
     }
 
@@ -113,11 +117,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 #endif
     {
       iterator __ret = iterator(__position._M_node->_M_next);
-#if __cplusplus >= 201103L
       _M_erase(__position._M_const_cast());
-#else
-      _M_erase(__position);
-#endif
       return __ret;
     }
 
index 97424fa7a7d27ffd728d0401f0304c26a6c24f79..489d819f06fc1907036e243c8713c97dc2261044 100644 (file)
@@ -222,6 +222,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     _Bit_iterator(_Bit_type * __x, unsigned int __y)
     : _Bit_iterator_base(__x, __y) { }
 
+    iterator
+    _M_const_cast() const
+    { return *this; }
+
     reference
     operator*() const
     { return reference(_M_p, 1UL << _M_offset); }
@@ -859,14 +863,18 @@ template<typename _Alloc>
     }
 
     iterator
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const bool& __x = bool())
+#else
     insert(iterator __position, const bool& __x = bool())
+#endif
     {
       const difference_type __n = __position - begin();
       if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_of_storage
          && __position == end())
         *this->_M_impl._M_finish++ = __x;
       else
-        _M_insert_aux(__position, __x);
+        _M_insert_aux(__position._M_const_cast(), __x);
       return begin() + __n;
     }
 
@@ -904,20 +912,18 @@ template<typename _Alloc>
     iterator
 #if __cplusplus >= 201103L
     erase(const_iterator __position)
-    { return _M_erase(__position._M_const_cast()); }
 #else
     erase(iterator __position)
-    { return _M_erase(__position); }
 #endif
+    { return _M_erase(__position._M_const_cast()); }
 
     iterator
 #if __cplusplus >= 201103L
     erase(const_iterator __first, const_iterator __last)
-    { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 #else
     erase(iterator __first, iterator __last)
-    { return _M_erase(__first, __last); }
 #endif
+    { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 
     void
     resize(size_type __new_size, bool __x = bool())
index 4bea82b180706f35f9297cb68184f511e88d77b2..a03ba256b53a15a47f5f4dfde110de61eb42030d 100644 (file)
@@ -1458,7 +1458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 #if __cplusplus >= 201103L
       /**
        *  @brief  Inserts an object in %deque before specified iterator.
-       *  @param  __position  Aiterator into the %deque.
+       *  @param  __position  A const_iterator into the %deque.
        *  @param  __args  Arguments.
        *  @return  An iterator that points to the inserted data.
        *
@@ -1467,9 +1467,20 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args);
-#endif
+        emplace(const_iterator __position, _Args&&... __args);
 
+      /**
+       *  @brief  Inserts given value into %deque before specified iterator.
+       *  @param  __position  A const_iterator into the %deque.
+       *  @param  __x  Data to be inserted.
+       *  @return  An iterator that points to the inserted data.
+       *
+       *  This function will insert a copy of the given value before the
+       *  specified location.
+       */
+      iterator
+      insert(const_iterator __position, const value_type& __x);
+#else
       /**
        *  @brief  Inserts given value into %deque before specified iterator.
        *  @param  __position  An iterator into the %deque.
@@ -1481,11 +1492,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       iterator
       insert(iterator __position, const value_type& __x);
+#endif
 
 #if __cplusplus >= 201103L
       /**
        *  @brief  Inserts given rvalue into %deque before specified iterator.
-       *  @param  __position  Aiterator into the %deque.
+       *  @param  __position  A const_iterator into the %deque.
        *  @param  __x  Data to be inserted.
        *  @return  An iterator that points to the inserted data.
        *
@@ -1493,7 +1505,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  specified location.
        */
       iterator
-      insert(iterator __position, value_type&& __x)
+      insert(const_iterator __position, value_type&& __x)
       { return emplace(__position, std::move(__x)); }
 
       /**
@@ -1568,11 +1580,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       iterator
 #if __cplusplus >= 201103L
       erase(const_iterator __position)
-      { return _M_erase(__position._M_const_cast()); }
 #else
       erase(iterator __position)
-      { return _M_erase(__position); }
 #endif
+      { return _M_erase(__position._M_const_cast()); }
 
       /**
        *  @brief  Remove a range of elements.
@@ -1593,11 +1604,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       iterator
 #if __cplusplus >= 201103L
       erase(const_iterator __first, const_iterator __last)
-      { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 #else
       erase(iterator __first, iterator __last)
-      { return _M_erase(__first, __last); }
 #endif
+      { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 
       /**
        *  @brief  Swaps data with another %deque.
index 50b55eb57b422262e91fac404644927dfc46717b..9952c2c92d6bbe25563e3cfa3d938278417cbd99 100644 (file)
@@ -734,19 +734,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                      _Container>::__type>& __i)
         : _M_current(__i.base()) { }
 
+#if __cplusplus >= 201103L
       __normal_iterator<typename _Container::pointer, _Container>
       _M_const_cast() const
       {
-#if __cplusplus >= 201103L
        using _PTraits = std::pointer_traits<typename _Container::pointer>;
        return __normal_iterator<typename _Container::pointer, _Container>
          (_PTraits::pointer_to(const_cast<typename _PTraits::element_type&>
                                (*_M_current)));
+      }
 #else
-        return __normal_iterator<typename _Container::pointer, _Container>
-         (const_cast<typename _Container::pointer>(_M_current));
+      __normal_iterator
+      _M_const_cast() const
+      { return *this; }
 #endif
-      }
 
       // Forward iterator requirements
       reference
index 678947107f30554fd4f64721745f749d6c80a157..7c3eb159abaf67b89476762e5f8cb92b886f40fc 100644 (file)
@@ -140,6 +140,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       _List_iterator(__detail::_List_node_base* __x)
       : _M_node(__x) { }
 
+      _Self
+      _M_const_cast() const
+      { return *this; }
+
       // Must downcast from _List_node_base to _List_node to get to _M_data.
       reference
       operator*() const
@@ -1060,9 +1064,22 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args);
-#endif
+        emplace(const_iterator __position, _Args&&... __args);
 
+      /**
+       *  @brief  Inserts given value into %list before specified iterator.
+       *  @param  __position  A const_iterator into the %list.
+       *  @param  __x  Data to be inserted.
+       *  @return  An iterator that points to the inserted data.
+       *
+       *  This function will insert a copy of the given value before
+       *  the specified location.  Due to the nature of a %list this
+       *  operation can be done in constant time, and does not
+       *  invalidate iterators and references.
+       */
+      iterator
+      insert(const_iterator __position, const value_type& __x);
+#else
       /**
        *  @brief  Inserts given value into %list before specified iterator.
        *  @param  __position  An iterator into the %list.
@@ -1076,11 +1093,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       iterator
       insert(iterator __position, const value_type& __x);
+#endif
 
 #if __cplusplus >= 201103L
       /**
        *  @brief  Inserts given rvalue into %list before specified iterator.
-       *  @param  __position  Aiterator into the %list.
+       *  @param  __position  A const_iterator into the %list.
        *  @param  __x  Data to be inserted.
        *  @return  An iterator that points to the inserted data.
        *
@@ -1090,7 +1108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  invalidate iterators and references.
         */
       iterator
-      insert(iterator __position, value_type&& __x)
+      insert(const_iterator __position, value_type&& __x)
       { return emplace(__position, std::move(__x)); }
 
       /**
@@ -1206,11 +1224,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       {
        while (__first != __last)
          __first = erase(__first);
-#if __cplusplus >= 201103L
        return __last._M_const_cast();
-#else
-       return __last;
-#endif
       }
 
       /**
index 5ac575460a0edf039eb42ba1c1a0c77342243825..a403b4f83bb33d366493fc67f42b8a3bd28ef478 100644 (file)
@@ -943,7 +943,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 #if __cplusplus >= 201103L
       /**
        *  @brief  Inserts an object in %vector before specified iterator.
-       *  @param  __position  Aiterator into the %vector.
+       *  @param  __position  A const_iterator into the %vector.
        *  @param  __args  Arguments.
        *  @return  An iterator that points to the inserted data.
        *
@@ -955,9 +955,22 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args);
-#endif
+        emplace(const_iterator __position, _Args&&... __args);
 
+      /**
+       *  @brief  Inserts given value into %vector before specified iterator.
+       *  @param  __position  A const_iterator into the %vector.
+       *  @param  __x  Data to be inserted.
+       *  @return  An iterator that points to the inserted data.
+       *
+       *  This function will insert a copy of the given value before
+       *  the specified location.  Note that this kind of operation
+       *  could be expensive for a %vector and if it is frequently
+       *  used the user should consider using std::list.
+       */
+      iterator
+      insert(const_iterator __position, const value_type& __x);
+#else
       /**
        *  @brief  Inserts given value into %vector before specified iterator.
        *  @param  __position  An iterator into the %vector.
@@ -971,11 +984,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        */
       iterator
       insert(iterator __position, const value_type& __x);
+#endif
 
 #if __cplusplus >= 201103L
       /**
        *  @brief  Inserts given rvalue into %vector before specified iterator.
-       *  @param  __position  Aiterator into the %vector.
+       *  @param  __position  A const_iterator into the %vector.
        *  @param  __x  Data to be inserted.
        *  @return  An iterator that points to the inserted data.
        *
@@ -985,7 +999,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  used the user should consider using std::list.
        */
       iterator
-      insert(iterator __position, value_type&& __x)
+      insert(const_iterator __position, value_type&& __x)
       { return emplace(__position, std::move(__x)); }
 
       /**
@@ -1074,11 +1088,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       iterator
 #if __cplusplus >= 201103L
       erase(const_iterator __position)
-      { return _M_erase(__position._M_const_cast()); }
 #else
       erase(iterator __position)
-      { return _M_erase(__position); }
 #endif
+      { return _M_erase(__position._M_const_cast()); }
 
       /**
        *  @brief  Remove a range of elements.
@@ -1101,11 +1114,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       iterator
 #if __cplusplus >= 201103L
       erase(const_iterator __first, const_iterator __last)
-      { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 #else
       erase(iterator __first, iterator __last)
-      { return _M_erase(__first, __last); }
 #endif
+      { return _M_erase(__first._M_const_cast(), __last._M_const_cast()); }
 
       /**
        *  @brief  Swaps data with another %vector.
@@ -1119,7 +1131,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       void
       swap(vector& __x)
 #if __cplusplus >= 201103L
-                       noexcept(_Alloc_traits::_S_nothrow_swap())
+      noexcept(_Alloc_traits::_S_nothrow_swap())
 #endif
       {
        this->_M_impl._M_swap_data(__x._M_impl);
index d26cfafd1fa2f5f68e48d1225e2506359d9956d3..8e22d10a26e5a36e04a114cc5ebc5b9c45f18d7c 100644 (file)
@@ -105,7 +105,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
   template<typename _Tp, typename _Alloc>
     typename vector<_Tp, _Alloc>::iterator
     vector<_Tp, _Alloc>::
+#if __cplusplus >= 201103L
+    insert(const_iterator __position, const value_type& __x)
+#else
     insert(iterator __position, const value_type& __x)
+#endif
     {
       const size_type __n = __position - begin();
       if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
@@ -120,11 +124,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
          if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
            {
              _Tp __x_copy = __x;
-             _M_insert_aux(__position, std::move(__x_copy));
+             _M_insert_aux(__position._M_const_cast(), std::move(__x_copy));
            }
          else
 #endif
-           _M_insert_aux(__position, __x);
+           _M_insert_aux(__position._M_const_cast(), __x);
        }
       return iterator(this->_M_impl._M_start + __n);
     }
@@ -292,7 +296,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     template<typename... _Args>
       typename vector<_Tp, _Alloc>::iterator
       vector<_Tp, _Alloc>::
-      emplace(iterator __position, _Args&&... __args)
+      emplace(const_iterator __position, _Args&&... __args)
       {
        const size_type __n = __position - begin();
        if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage
@@ -303,7 +307,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
            ++this->_M_impl._M_finish;
          }
        else
-         _M_insert_aux(__position, std::forward<_Args>(__args)...);
+         _M_insert_aux(__position._M_const_cast(),
+                       std::forward<_Args>(__args)...);
        return iterator(this->_M_impl._M_start + __n);
       }
 
index 2ac6d252e1ddca939ff86fd3bd7e691aafe1cba5..638bf1cd3ca1e07accfa59ce07529e2f2d8e436d 100644 (file)
@@ -383,7 +383,7 @@ namespace __debug
 
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args)
+        emplace(const_iterator __position, _Args&&... __args)
        {
          __glibcxx_check_insert(__position);
          _Base_iterator __res = _Base::emplace(__position.base(),
@@ -394,7 +394,11 @@ namespace __debug
 #endif
 
       iterator
+#if __cplusplus >= 201103L
+      insert(const_iterator __position, const _Tp& __x)
+#else
       insert(iterator __position, const _Tp& __x)
+#endif
       {
        __glibcxx_check_insert(__position);
        _Base_iterator __res = _Base::insert(__position.base(), __x);
@@ -404,7 +408,7 @@ namespace __debug
 
 #if __cplusplus >= 201103L
       iterator
-      insert(iterator __position, _Tp&& __x)
+      insert(const_iterator __position, _Tp&& __x)
       { return emplace(__position, std::move(__x)); }
 
       void
index 9bc47124f3939a74223864ebb05c73b64b0a8168..c175de01f23a87a3808eca217cd6470ab8763d2c 100644 (file)
@@ -379,7 +379,7 @@ namespace __debug
 #if __cplusplus >= 201103L
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args)
+        emplace(const_iterator __position, _Args&&... __args)
        {
          __glibcxx_check_insert(__position);
          return iterator(_Base::emplace(__position.base(),
@@ -387,16 +387,20 @@ namespace __debug
        }
 #endif
 
-      iterator
-      insert(iterator __position, const _Tp& __x)
-      {
-       __glibcxx_check_insert(__position);
-       return iterator(_Base::insert(__position.base(), __x), this);
-      }
+     iterator
+#if __cplusplus >= 201103L
+     insert(const_iterator __position, const _Tp& __x)
+#else
+     insert(iterator __position, const _Tp& __x)
+#endif
+     {
+       __glibcxx_check_insert(__position);
+       return iterator(_Base::insert(__position.base(), __x), this);
+     }
 
 #if __cplusplus >= 201103L
       iterator
-      insert(iterator __position, _Tp&& __x)
+      insert(const_iterator __position, _Tp&& __x)
       { return emplace(__position, std::move(__x)); }
 
       void
index 4a65518bc8253e09e96442fd647868f851026427..f55dc67ede019e1ddb1256de63bda98dc38d9f36 100644 (file)
@@ -429,7 +429,7 @@ namespace __debug
 #if __cplusplus >= 201103L
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args)
+        emplace(const_iterator __position, _Args&&... __args)
        {
          __glibcxx_check_insert(__position);
          bool __realloc = _M_requires_reallocation(this->size() + 1);
@@ -446,7 +446,11 @@ namespace __debug
 #endif
 
       iterator
+#if __cplusplus >= 201103L
+      insert(const_iterator __position, const _Tp& __x)
+#else
       insert(iterator __position, const _Tp& __x)
+#endif
       {
        __glibcxx_check_insert(__position);
        bool __realloc = _M_requires_reallocation(this->size() + 1);
@@ -464,7 +468,7 @@ namespace __debug
       template<typename _Up = _Tp>
         typename __gnu_cxx::__enable_if<!std::__are_same<_Up, bool>::__value,
                                        iterator>::__type
-        insert(iterator __position, _Tp&& __x)
+        insert(const_iterator __position, _Tp&& __x)
         { return emplace(__position, std::move(__x)); }
 
       void
index 716d145f1841a46033c9db70fe72cc8c29a347c1..c78f2146a13d576f95063e3453cc73ff0dcbcbb7 100644 (file)
@@ -1087,7 +1087,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  change if an error is thrown.
       */
       iterator
-      insert(iterator __p, _CharT __c)
+#if __cplusplus >= 201103L
+      insert(const_iterator __p, _CharT __c)
+#else
+      insert(iterator __p, _CharT __c) 
+#endif
       {
        _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
        const size_type __pos = __p - _M_ibegin();
@@ -1313,7 +1317,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  the string doesn't change if an error is thrown.
       */
       __versa_string&
+#if __cplusplus >= 201103L
+      replace(const_iterator __i1, const_iterator __i2,
+             const __versa_string& __str)
+#else
       replace(iterator __i1, iterator __i2, const __versa_string& __str)
+#endif
       { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
 
       /**
@@ -1331,7 +1340,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  value of the string doesn't change if an error is thrown.
       */
       __versa_string&
+#if __cplusplus >= 201103L
+      replace(const_iterator __i1, const_iterator __i2,
+             const _CharT* __s, size_type __n)
+#else
       replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+#endif
       {
        _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
                                 && __i2 <= _M_iend());
@@ -1352,7 +1366,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  the string doesn't change if an error is thrown.
       */
       __versa_string&
-      replace(iterator __i1, iterator __i2, const _CharT* __s)
+#if __cplusplus >= 201103L
+      replace(const_iterator __i1, const_iterator __i2, const _CharT* __s)
+#else
+      replace(iterator __i1, iterator __i2, const _CharT* __s) 
+#endif
       {
        __glibcxx_requires_string(__s);
        return this->replace(__i1, __i2, __s, traits_type::length(__s));
@@ -1373,7 +1391,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  the string doesn't change if an error is thrown.
       */
       __versa_string&
+#if __cplusplus >= 201103L
+      replace(const_iterator __i1, const_iterator __i2, size_type __n,
+             _CharT __c)
+#else
       replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+#endif
       {
        _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
                                 && __i2 <= _M_iend());
index 9943e1e9f02ae72dc37cdc3142247a7beea5a953..0ec98386baefcb0c5d41e18ab88f990077f3dee7 100644 (file)
@@ -320,7 +320,7 @@ namespace __profile
 
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args)
+        emplace(const_iterator __position, _Args&&... __args)
        {
          typename _Base::iterator __res = _Base::emplace(__position,
                                            std::forward<_Args>(__args)...);
@@ -329,7 +329,11 @@ namespace __profile
 #endif
 
       iterator
+#if __cplusplus >= 201103L
+      insert(const_iterator __position, const _Tp& __x)
+#else
       insert(iterator __position, const _Tp& __x)
+#endif
       {
        typename _Base::iterator __res = _Base::insert(__position, __x);
        return iterator(__res);
@@ -337,7 +341,7 @@ namespace __profile
 
 #if __cplusplus >= 201103L
       iterator
-      insert(iterator __position, _Tp&& __x)
+      insert(const_iterator __position, _Tp&& __x)
       { return emplace(__position, std::move(__x)); }
 
       void
index 25ad11248b1d9f8aee7f755834be19680bd8053a..3a68bf7493a62b32ad3331be1d272cafe9f70eed 100644 (file)
@@ -335,7 +335,7 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
 #if __cplusplus >= 201103L
       template<typename... _Args>
         iterator
-        emplace(iterator __position, _Args&&... __args)
+        emplace(const_iterator __position, _Args&&... __args)
        {
          return iterator(_Base::emplace(__position.base(),
                                          std::forward<_Args>(__args)...),
@@ -344,7 +344,11 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
 #endif
 
       iterator
+#if __cplusplus >= 201103L
+      insert(const_iterator __position, const _Tp& __x)
+#else
       insert(iterator __position, const _Tp& __x)
+#endif
       {
         _M_profile_insert(this, __position, size());
         return iterator(_Base::insert(__position.base(), __x), this);
@@ -352,8 +356,8 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
 
 #if __cplusplus >= 201103L
       iterator
-      insert(iterator __position, _Tp&& __x)
-      { 
+      insert(const_iterator __position, _Tp&& __x)
+      {
         _M_profile_insert(this, __position, size());
         return iterator(_Base::emplace(__position.base(), std::move(__x)),
                         this); 
@@ -606,11 +610,12 @@ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
       }
 
     private:
-      size_type _M_profile_insert(void* obj, iterator __pos, size_type __size)
+      size_type
+      _M_profile_insert(void* obj, const_iterator __pos, size_type __size)
       {
         size_type __shift = 0;
-        typename _Base::iterator __it = __pos.base();
-        for ( ; __it!=_Base::end(); __it++)
+        typename _Base::const_iterator __it = __pos.base();
+        for (; __it != _Base::end(); ++__it)
           __shift++;
         __profcxx_list_rewind(this);
         __profcxx_list_operation(this);
index d9eb15740c649226f1f14553a42a04c02a15aa3a..de058d0d8142f69e2c45b4915530de70463efaaf 100644 (file)
@@ -352,7 +352,11 @@ namespace __profile
 #endif
 
       iterator
+#if __cplusplus >= 201103L
+      insert(const_iterator __position, const _Tp& __x)
+#else
       insert(iterator __position, const _Tp& __x)
+#endif
       {
         __profcxx_vector_insert(this, __position.base() - _Base::begin(),
                                 this->size());
@@ -364,7 +368,7 @@ namespace __profile
 
 #if __cplusplus >= 201103L
       iterator
-      insert(iterator __position, _Tp&& __x)
+      insert(const_iterator __position, _Tp&& __x)
       {
         __profcxx_vector_insert(this, __position.base() - _Base::begin(),
                                 this->size());
@@ -374,6 +378,16 @@ namespace __profile
        return iterator(__res, this);
       }
 
+      template<typename... _Args>
+        iterator
+        emplace(const_iterator __position, _Args&&... __args)
+        {
+         typename _Base::iterator __res
+           = _Base::emplace(__position.base(),
+                            std::forward<_Args>(__args)...);
+         return iterator(__res, this);
+       }
+
       void
       insert(iterator __position, initializer_list<value_type> __l)
       { this->insert(__position, __l.begin(), __l.end()); }
@@ -423,7 +437,6 @@ namespace __profile
         _M_profile_resize(this, __old_size, this->capacity());
       }
 
-
       iterator
 #if __cplusplus >= 201103L
       erase(const_iterator __position)
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc
new file mode 100644 (file)
index 0000000..d4898b3
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <deque>
+
+void test01()
+{
+  std::deque<int> d1;
+  d1.emplace(d1.cbegin(), 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc
new file mode 100644 (file)
index 0000000..915aa68
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <deque>
+
+void test01()
+{
+  std::deque<int> d1;
+  int n = 0;
+  d1.insert(d1.cbegin(), n);
+  d1.insert(d1.cbegin(), 1);
+}
index ccb63ef83eea090d724e90d8426e589205cf73bd..9788b4d952d980debe3104894723908d5f5df972 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1714 }
+// { dg-error "no matching" "" { target *-*-* } 1724 }
 
 #include <deque>
 
index 0a5db6362b5dd4dacdea29a8d3c259d5bb782a91..a85b5c3f9f8fa872b8f38bf96aa2d0f62bb4a473 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1647 }
+// { dg-error "no matching" "" { target *-*-* } 1657 }
 
 #include <deque>
 
index 7572322c6b460572f0736d0753ca70feb114ef58..162bdf0bf95af104d295054850c5ae0b9c6da930 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1647 }
+// { dg-error "no matching" "" { target *-*-* } 1657 }
 
 #include <deque>
 #include <utility>
index b109d3896e40e77314be35d9351de978e90fe91d..7e8356fd7632f9bb47d38a190ee5f76bb1c7135c 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1798 }
+// { dg-error "no matching" "" { target *-*-* } 1808 }
 
 #include <deque>
 
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc
new file mode 100644 (file)
index 0000000..d5aef75
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <list>
+
+void test01()
+{
+  std::list<int> l1;
+  l1.emplace(l1.cbegin(), 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc
new file mode 100644 (file)
index 0000000..156bc0a
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <list>
+
+void test01()
+{
+  std::list<int> l1;
+  int n = 0;
+  l1.insert(l1.cbegin(), n);
+  l1.insert(l1.cbegin(), 1);
+}
index 4ccd652bbd287eb4e735b7314e5de08b7391ab8a..218b862e34868b4de3915b2eed2c96840eb6cbbb 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1545 }
+// { dg-error "no matching" "" { target *-*-* } 1559 }
 
 #include <list>
 
index 6bc01b7ec7c1a1403861dd55dab44dfc51a1c3d3..3f0b74939b1f39e6fd5a65b2d4ffe9dc111afeaa 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1497 }
+// { dg-error "no matching" "" { target *-*-* } 1511 }
 
 #include <list>
 
index 1f39056e376a4f8e70bc30b503f4266325850afa..b861f46fde2601af8a59cabe5d96e78cd7ec5c5f 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1497 }
+// { dg-error "no matching" "" { target *-*-* } 1511 }
 
 #include <list>
 #include <utility>
index 902f55ab2fdc5b53a717ecadbf5f264e75196f3d..fd38c0b36d611c13cffb2accf7e0716edc578aa3 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1497 }
+// { dg-error "no matching" "" { target *-*-* } 1511 }
 
 #include <list>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/const_iterator.cc
new file mode 100644 (file)
index 0000000..b8993d8
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+void test01()
+{
+  std::vector<bool> vb1;
+  vb1.insert(vb1.cbegin(), true);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc
new file mode 100644 (file)
index 0000000..8e2a194
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+void test01()
+{
+  std::vector<int> v1;
+  v1.emplace(v1.cbegin(), 1);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc
new file mode 100644 (file)
index 0000000..5e5ef9e
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+void test01()
+{
+  std::vector<int> v1;
+  int n = 0;
+  v1.insert(v1.cbegin(), n);
+  v1.insert(v1.cbegin(), 1);
+}
index 2dbc60240a26c196fe0818bbbac85330c489a61f..e94346772821cbbb0c2bd6a7df0712dc8e3aee74 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1252 }
+// { dg-error "no matching" "" { target *-*-* } 1264 }
 
 #include <vector>
 
index 7fc56bd4286bb7c8642e4f8b907d72a88e022da3..ba14bcef2addc5e67a56b19f87faa69f291c9d10 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1178 }
+// { dg-error "no matching" "" { target *-*-* } 1190 }
 
 #include <vector>
 
index 6a374618ce58f59282e6ae6cf06f5fd1f871fd90..c9ac43782c4f4b97052331798cc9b8c51b645e9d 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1178 }
+// { dg-error "no matching" "" { target *-*-* } 1190 }
 
 #include <vector>
 #include <utility>
index 3f5abb903cb145efcfd8846f89701f7cb9c8b811..343edc2c7f3a4b92fa02e307e6251a6ee81d1855 100644 (file)
@@ -18,7 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1293 }
+// { dg-error "no matching" "" { target *-*-* } 1305 }
 
 #include <vector>
 
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/char/54577.cc
deleted file mode 100644 (file)
index 979828b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// { dg-options "-std=gnu++11" }
-// { dg-do compile }
-
-// Copyright (C) 2013 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
-// <http://www.gnu.org/licenses/>.
-
-#include <ext/vstring.h>
-
-void test01() 
-{
-  __gnu_cxx::__vstring vs1;
-  vs1.push_back('1');
-  vs1.erase(vs1.cbegin());
-
-  __gnu_cxx::__vstring vs2;
-  vs2.push_back('2');
-  vs2.push_back('3');
-  vs2.erase(vs2.cbegin(), vs2.cend());
-}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc
deleted file mode 100644 (file)
index cec1d22..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2011-2013 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
-// <http://www.gnu.org/licenses/>.
-
-// 21.4.6.5 basic_string::pop_back
-// { dg-options "-std=gnu++0x" }
-
-#include <ext/vstring.h>
-#include <testsuite_hooks.h>
-
-template<typename StrT>
-int test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const StrT cstr("Badger");
-  StrT str = cstr;
-  str.pop_back();
-  VERIFY( str.size() == cstr.size() - 1 );
-
-  str += cstr.back();
-  VERIFY( str == cstr );
-
-  return test;
-}
-
-int main()
-{ 
-  test01<__gnu_cxx::__sso_string>();
-  test01<__gnu_cxx::__rc_string>();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/char/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/char/54577.cc
new file mode 100644 (file)
index 0000000..979828b
--- /dev/null
@@ -0,0 +1,33 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__vstring vs1;
+  vs1.push_back('1');
+  vs1.erase(vs1.cbegin());
+
+  __gnu_cxx::__vstring vs2;
+  vs2.push_back('2');
+  vs2.push_back('3');
+  vs2.erase(vs2.cbegin(), vs2.cend());
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/wchar_t/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/wchar_t/54577.cc
new file mode 100644 (file)
index 0000000..f514099
--- /dev/null
@@ -0,0 +1,33 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__wvstring wvs1;
+  wvs1.push_back(L'1');
+  wvs1.erase(wvs1.cbegin());
+
+  __gnu_cxx::__wvstring wvs2;
+  wvs2.push_back(L'2');
+  wvs2.push_back(L'3');
+  wvs2.erase(wvs2.cbegin(), wvs2.cend());
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc
new file mode 100644 (file)
index 0000000..223ab66
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__vstring vs1;
+  vs1.insert(vs1.cbegin(), '1');
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc
new file mode 100644 (file)
index 0000000..57fee54
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__wvstring wvs1;
+  wvs1.insert(wvs1.cbegin(), L'1');
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/char/1.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/char/1.cc
new file mode 100644 (file)
index 0000000..cec1d22
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+template<typename StrT>
+int test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const StrT cstr("Badger");
+  StrT str = cstr;
+  str.pop_back();
+  VERIFY( str.size() == cstr.size() - 1 );
+
+  str += cstr.back();
+  VERIFY( str == cstr );
+
+  return test;
+}
+
+int main()
+{ 
+  test01<__gnu_cxx::__sso_string>();
+  test01<__gnu_cxx::__rc_string>();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/wchar_t/1.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/wchar_t/1.cc
new file mode 100644 (file)
index 0000000..ee8de53
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 21.4.6.5 basic_string::pop_back
+// { dg-options "-std=gnu++0x" }
+
+#include <ext/vstring.h>
+#include <testsuite_hooks.h>
+
+template<typename StrT>
+int test01()
+{
+  bool test __attribute__((unused)) = true;
+
+  const StrT cstr(L"Badger");
+  StrT str = cstr;
+  str.pop_back();
+  VERIFY( str.size() == cstr.size() - 1 );
+
+  str += cstr.back();
+  VERIFY( str == cstr );
+
+  return test;
+}
+
+int main()
+{ 
+  test01<__gnu_cxx::__wsso_string>();
+  test01<__gnu_cxx::__wrc_string>();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc
new file mode 100644 (file)
index 0000000..0838443
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__vstring vs1;
+  vs1.replace(vs1.cbegin(), vs1.cend(), vs1);
+  vs1.replace(vs1.cbegin(), vs1.cend(), "1", 1);
+  vs1.replace(vs1.cbegin(), vs1.cend(), "2");
+  vs1.replace(vs1.cbegin(), vs1.cend(), 1, '3');
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc
new file mode 100644 (file)
index 0000000..a909c9c
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <ext/vstring.h>
+
+void test01() 
+{
+  __gnu_cxx::__wvstring wvs1;
+  wvs1.replace(wvs1.cbegin(), wvs1.cend(), wvs1);
+  wvs1.replace(wvs1.cbegin(), wvs1.cend(), L"1", 1);
+  wvs1.replace(wvs1.cbegin(), wvs1.cend(), L"2");
+  wvs1.replace(wvs1.cbegin(), wvs1.cend(), 1, L'3');
+}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/54577.cc
deleted file mode 100644 (file)
index f514099..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// { dg-options "-std=gnu++11" }
-// { dg-do compile }
-
-// Copyright (C) 2013 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
-// <http://www.gnu.org/licenses/>.
-
-#include <ext/vstring.h>
-
-void test01() 
-{
-  __gnu_cxx::__wvstring wvs1;
-  wvs1.push_back(L'1');
-  wvs1.erase(wvs1.cbegin());
-
-  __gnu_cxx::__wvstring wvs2;
-  wvs2.push_back(L'2');
-  wvs2.push_back(L'3');
-  wvs2.erase(wvs2.cbegin(), wvs2.cend());
-}
diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc
deleted file mode 100644 (file)
index ee8de53..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2011-2013 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
-// <http://www.gnu.org/licenses/>.
-
-// 21.4.6.5 basic_string::pop_back
-// { dg-options "-std=gnu++0x" }
-
-#include <ext/vstring.h>
-#include <testsuite_hooks.h>
-
-template<typename StrT>
-int test01()
-{
-  bool test __attribute__((unused)) = true;
-
-  const StrT cstr(L"Badger");
-  StrT str = cstr;
-  str.pop_back();
-  VERIFY( str.size() == cstr.size() - 1 );
-
-  str += cstr.back();
-  VERIFY( str == cstr );
-
-  return test;
-}
-
-int main()
-{ 
-  test01<__gnu_cxx::__wsso_string>();
-  test01<__gnu_cxx::__wrc_string>();
-  return 0;
-}
index c063c9bddb715158c79727847bb2bcc064c2665d..5ba9b13ce375069a0406137598d14f39c13a2ef1 100644 (file)
@@ -265,7 +265,7 @@ namespace __gnu_test
        : _F_erase_point(&_Tp::erase), _F_erase_range(&_Tp::erase) { }
       };
 
-    // Specializations, old C++03 signatures.
+    // Specialization, old C++03 signature.
     template<typename _Tp1, typename _Tp2, typename _Tp3>
       struct erase_base<std::basic_string<_Tp1, _Tp2, _Tp3>>
       {
@@ -280,24 +280,6 @@ namespace __gnu_test
          _F_erase_range(&container_type::erase) { }
       };
 
-    template<typename _Tp1, typename _Tp2, typename _Tp3,
-            template <typename, typename, typename> class _Tp4>
-      struct erase_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>>
-      {
-       typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>
-                                                       container_type;
-       typedef typename container_type::iterator       iterator;
-       typedef typename container_type::const_iterator const_iterator;
-
-       iterator (container_type::* _F_erase_point)(const_iterator);
-       iterator (container_type::* _F_erase_range)(const_iterator,
-                                                   const_iterator);
-
-       erase_base()
-       : _F_erase_point(&container_type::erase),
-         _F_erase_range(&container_type::erase) { }
-      };
-
     // Specialization, as forward_list has erase_after.
     template<typename _Tp1, typename _Tp2>
       struct erase_base<std::forward_list<_Tp1, _Tp2>>
@@ -698,47 +680,7 @@ namespace __gnu_test
        insert_base() : _F_insert_point(&_Tp::insert) { }
       };
 
-    // Specializations, old C++03 signatures.
-    template<typename _Tp1, typename _Tp2>
-      struct insert_base<std::deque<_Tp1, _Tp2>>
-      {
-       typedef std::deque<_Tp1, _Tp2>                  container_type;
-       typedef typename container_type::iterator       iterator;
-       typedef typename container_type::value_type     value_type;
-
-       iterator (container_type::* _F_insert_point)(iterator,
-                                                    const value_type&);
-
-       insert_base() : _F_insert_point(&container_type::insert) { }
-      };
-
-    template<typename _Tp1, typename _Tp2>
-      struct insert_base<std::list<_Tp1, _Tp2>>
-      {
-       typedef std::list<_Tp1, _Tp2>                   container_type;
-       typedef typename container_type::iterator       iterator;
-       typedef typename container_type::value_type     value_type;
-
-       iterator (container_type::* _F_insert_point)(iterator,
-                                                    const value_type&);
-
-       insert_base() : _F_insert_point(&container_type::insert) { }
-      };
-
-    template<typename _Tp1, typename _Tp2>
-      struct insert_base<std::vector<_Tp1, _Tp2>>
-      {
-       typedef std::vector<_Tp1, _Tp2>                 container_type;
-       typedef typename container_type::iterator       iterator;
-       typedef typename container_type::value_type     value_type;
-
-       iterator (container_type::* _F_insert_point)(iterator,
-                                                    const value_type&);
-
-       insert_base() : _F_insert_point(&container_type::insert) { }
-      };
-
-    // Specialization, as string insertion has a different signature.
+    // Specialization, old C++03 signature.
     template<typename _Tp1, typename _Tp2, typename _Tp3>
       struct insert_base<std::basic_string<_Tp1, _Tp2, _Tp3>>
       {
@@ -751,17 +693,19 @@ namespace __gnu_test
        insert_base() : _F_insert_point(&container_type::insert) { }
       };
 
-    // Likewise for __versa_string.
+    // Specialization, by value.
     template<typename _Tp1, typename _Tp2, typename _Tp3,
             template <typename, typename, typename> class _Tp4>
       struct insert_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>>
       {
        typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>
-                                                       container_type;
-       typedef typename container_type::iterator       iterator;
-       typedef typename container_type::value_type     value_type;
+                                                        container_type;
+       typedef typename container_type::iterator       iterator;
+       typedef typename container_type::const_iterator const_iterator;
+       typedef typename container_type::value_type     value_type;
 
-       iterator (container_type::* _F_insert_point)(iterator, value_type);
+       iterator (container_type::* _F_insert_point)(const_iterator,
+                                                    value_type);
 
        insert_base() : _F_insert_point(&container_type::insert) { }
       };