[Bug libstdc++/62169] map iterators under _GLIBCXX_DEBUG diverge

terra at gnome dot org gcc-bugzilla@gcc.gnu.org
Sun Aug 24 00:07:00 GMT 2014


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?



More information about the Gcc-bugs mailing list