summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-09 01:00:25 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-09 01:00:25 +0000
commit4eeb06cdea34b612677ed137beec7da2d45a8f21 (patch)
treee27caee4bafbee23a1d74d1e66f4c317f0ef8ac7
parent96595b4d0a4e0ca3739671e6063ff39def52bd46 (diff)
downloadppe42-gcc-4eeb06cdea34b612677ed137beec7da2d45a8f21.tar.gz
ppe42-gcc-4eeb06cdea34b612677ed137beec7da2d45a8f21.zip
2007-02-08 Howard Hinnant <hhinnant@apple.com>
PR libstdc++/17012 * include/bits/list.tcc (list<>::remove): Take care of &*__first == &__value. * docs/html/ext/howto.html: Add an entry for DR 526. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121735 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/docs/html/ext/howto.html7
-rw-r--r--libstdc++-v3/include/bits/list.tcc15
3 files changed, 27 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 1610a6079eb..1effedd5fd0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-08 Howard Hinnant <hhinnant@apple.com>
+
+ PR libstdc++/17012
+ * include/bits/list.tcc (list<>::remove): Take care of
+ &*__first == &__value.
+ * docs/html/ext/howto.html: Add an entry for DR 526.
+
2007-02-07 Jakub Jelinek <jakub@redhat.com>
PR libgomp/28468
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index 951e108dacd..c3dcca4d213 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -586,6 +586,13 @@
<dd>Construct a <code>linear_congruential</code> engine and seed with it.
</dd>
+ <dt><a href="lwg-active.html#526">526</a>:
+ <em>Is it undefined if a function in the standard changes in
+ parameters?</em>
+ </dt>
+ <dd>Use &amp;value.
+ </dd>
+
<dt><a href="lwg-defects.html#538">538</a>:
<em>241 again: Does unique_copy() require CopyConstructible
and Assignable?</em>
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index f2849fb6e52..6bde3b77d00 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -1,6 +1,6 @@
// List implementation (out of line) -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -176,14 +176,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
{
iterator __first = begin();
iterator __last = end();
+ iterator __extra = __last;
while (__first != __last)
{
iterator __next = __first;
++__next;
if (*__first == __value)
- _M_erase(__first);
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 526. Is it undefined if a function in the standard changes
+ // in parameters?
+ if (&*__first != &__value)
+ _M_erase(__first);
+ else
+ __extra = __first;
+ }
__first = __next;
}
+ if (__extra != __last)
+ _M_erase(__extra);
}
template<typename _Tp, typename _Alloc>
OpenPOWER on IntegriCloud