summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/stl_list.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-10 15:18:33 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-10 15:18:33 +0000
commit6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91 (patch)
tree733216f9d05ef2101674b95a354adc2ed369f93c /libstdc++-v3/include/bits/stl_list.h
parent82b24465847d7b64dc4b01a6e95eb74621546bfb (diff)
downloadppe42-gcc-6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91.tar.gz
ppe42-gcc-6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91.zip
2013-05-10 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/54577 * include/bits/stl_deque.h (erase): Fix signatures in C++11 mode. (_Deque_iterator<>::_M_const_cast): Add. (deque<>::_M_erase): Declare. * include/bits/deque.tcc: ... and define. * include/bits/stl_list.h (erase): Fix signatures in C++11 mode. (_List_const_iterator<>::_M_const_cast): Add. * include/bits/list.tcc (erase (iterator)): Fix. * include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast): Add; include <ext/cast.h>. * include/bits/stl_vector.h (erase): Fix signatures in C++11 mode. (vector<>::_M_erase): Declare. * include/bits/stl_bvector.h: Likewise. * include/bits/vector.tcc (vector<>::_M_erase): Define. * include/ext/vstring.h (erase): Fix signatures in C++11 mode. * include/debug/deque: Adjust. * include/debug/list: Likewise. * include/debug/vector: Likewise. * include/profile/deque: Likewise. * include/profile/list: Likewise. * include/profile/vector: Likewise. * testsuite/util/exception/safety.h (erase_base<deque>, erase_base<deque>, erase_base<vector>): Remove. (erase_base<__versa_string>): Update. * testsuite/ext/vstring/modifiers/char/54577.cc: New. * testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Likewise. * testsuite/23_containers/deque/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/list/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/bool/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/vector/modifiers/erase/54577.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line numbers. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198790 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/stl_list.h')
-rw-r--r--libstdc++-v3/include/bits/stl_list.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 596760c2152..678947107f3 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -219,6 +219,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_List_const_iterator(const iterator& __x)
: _M_node(__x._M_node) { }
+ iterator
+ _M_const_cast() const
+ { return iterator(const_cast<__detail::_List_node_base*>(_M_node)); }
+
// Must downcast from List_node_base to _List_node to get to
// _M_data.
reference
@@ -1169,7 +1173,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* any way. Managing the pointer is the user's responsibility.
*/
iterator
+#if __cplusplus >= 201103L
+ erase(const_iterator __position);
+#else
erase(iterator __position);
+#endif
/**
* @brief Remove a range of elements.
@@ -1190,11 +1198,19 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* is the user's responsibility.
*/
iterator
+#if __cplusplus >= 201103L
+ erase(const_iterator __first, const_iterator __last)
+#else
erase(iterator __first, iterator __last)
+#endif
{
while (__first != __last)
__first = erase(__first);
+#if __cplusplus >= 201103L
+ return __last._M_const_cast();
+#else
return __last;
+#endif
}
/**
OpenPOWER on IntegriCloud