https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59161
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- This seems like a GDB bug, since all the pretty printer does is: def to_string(self): return self.val['_M_current'].dereference() So stringifying that is done by GDB, and should produce the "ref = @xxxxx" part. It does the right thing if we do: def to_string(self): return str(self.val['_M_current'].dereference()) But I don't think that should be necessary.