This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/62169] map iterators under _GLIBCXX_DEBUG diverge
- From: "terra at gnome dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Aug 2014 00:07:50 +0000
- Subject: [Bug libstdc++/62169] map iterators under _GLIBCXX_DEBUG diverge
- Auto-submitted: auto-generated
- References: <bug-62169-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62169
--- Comment #5 from M Welinder <terra at gnome dot org> ---
I agree that anyone depending on map and multimap iterators to mix deserves
whatever happens as a result. It would, however, be nice g++ would reject such
programs outright. Currently this is accepted:
std::map<int,int> foo;
std::multimap<int,int>::iterator = foo.end();
You get this kind of code when someone changes the container type and uses the
compiler to point out where further fixes are needed.
Is it an option to make the iterators different for the non-debug case too?
Would that be an ABI change?