http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59161
Bug ID: 59161 Summary: GDB pretty printers: iterator->reference not printed Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: jan.kratochvil at redhat dot com CC: pmuldoon at redhat dot com Target: x86_64-unknown-linux-gnu gdb a.out -ex 'b 11' -ex r -ex 'p it' (gdb) p it $3 = {ref = } ^^^^ = bug (gdb) p *it $2 = (C &) @0x603010: {ref = @0x7fffffffd928} (gdb) whatis it type = __gnu_cxx::__normal_iterator<C*, std::vector<C, std::allocator<C> > > #include <vector> class C { public: int &ref; C(int &ref_):ref(ref_) {} }; int main() { int d(1); std::vector<C> vec({d}); for (auto it=vec.begin();it!=vec.end();++it) { ++it->ref; // line 11 __attribute__((unused)) C *gdb_stub(&*it); } }