This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/41628] New: _GLIBCXX_DEBUG feature: check for unstable iterators
- From: "roland at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2009 01:44:11 -0000
- Subject: [Bug libstdc++/41628] New: _GLIBCXX_DEBUG feature: check for unstable iterators
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I just had a bug whose issue was using stale unstable iterators after
changing the container. It would be nice for _GLIBCXX_DEBUG to catch
those. e.g., container object holds a "mutation count" and
increments it on every call that is allowed to destabilize extant
iterators in the API (even if it doesn't, like a set insert with no
change if the spec says that can invalidate), iterator holds ptr to
container object and the mutation count sampled at iterator creation
time, all iterator ops throw if the mutation count no longer matches
the container.
--
Summary: _GLIBCXX_DEBUG feature: check for unstable iterators
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: roland at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41628