This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/59170] pretty printers: end iterator invalid pointer
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Dec 2016 13:54:02 +0000
- Subject: [Bug libstdc++/59170] pretty printers: end iterator invalid pointer
- Auto-submitted: auto-generated
- References: <bug-59170-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59170
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think it's simply wrong to automatically dereference iterators. GDB doesn't
do that when printing pointers, so why do the pretty printers do it for
iterators?
There are loads of cases where it does the wrong thing, not only for
past-the-end iterators but also for default-constructed ones that might contain
uninitialized pointers.