summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/debug/list
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-24 17:03:13 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-24 17:03:13 +0000
commite40f98cb51b4fec34e59d8ef5a22751f7142f589 (patch)
tree75ab990f4315b4b68c45c2a30a69ae1248c331fd /libstdc++-v3/include/debug/list
parent488f55199c275e6ad42a02878669856509322d78 (diff)
downloadppe42-gcc-e40f98cb51b4fec34e59d8ef5a22751f7142f589.tar.gz
ppe42-gcc-e40f98cb51b4fec34e59d8ef5a22751f7142f589.zip
2008-04-24 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/35969 * include/debug/list (merge): Use _M_transfer_iter, consistently with the splice members. * testsuite/23_containers/list/operations/35969.cc: New. * testsuite/23_containers/list/operators: Rename to testsuite/23_containers/list/operations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/debug/list')
-rw-r--r--libstdc++-v3/include/debug/list39
1 files changed, 25 insertions, 14 deletions
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index b071d4fcdd6..d0797e9bf46 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -1,6 +1,6 @@
// Debugging list implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -527,14 +527,19 @@ namespace __debug
merge(list& __x)
#endif
{
- __glibcxx_check_sorted(_Base::begin(), _Base::end());
- __glibcxx_check_sorted(__x.begin().base(), __x.end().base());
- for (iterator __tmp = __x.begin(); __tmp != __x.end(); )
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
{
- iterator __victim = __tmp++;
- __victim._M_attach(&__x);
+ __glibcxx_check_sorted(_Base::begin(), _Base::end());
+ __glibcxx_check_sorted(__x.begin().base(), __x.end().base());
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()));
}
- _Base::merge(_GLIBCXX_MOVE(__x._M_base()));
}
template<class _Compare>
@@ -545,15 +550,21 @@ namespace __debug
merge(list& __x, _Compare __comp)
#endif
{
- __glibcxx_check_sorted_pred(_Base::begin(), _Base::end(), __comp);
- __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(),
- __comp);
- for (iterator __tmp = __x.begin(); __tmp != __x.end(); )
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
{
- iterator __victim = __tmp++;
- __victim._M_attach(&__x);
+ __glibcxx_check_sorted_pred(_Base::begin(), _Base::end(),
+ __comp);
+ __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(),
+ __comp);
+ for (iterator __tmp = __x.begin(); __tmp != __x.end();)
+ {
+ iterator __victim = __tmp++;
+ this->_M_transfer_iter(__victim);
+ }
+ _Base::merge(_GLIBCXX_MOVE(__x._M_base()), __comp);
}
- _Base::merge(_GLIBCXX_MOVE(__x._M_base()), __comp);
}
void
OpenPOWER on IntegriCloud