this breaks debugging of std::map and other tree-based containers in the
library, see http://gcc.gnu.org/ml/libstdc++/2010-06/msg00159.html for more
info

$ cat debug2.cc
struct S
{
    typedef S* ptr;
    ptr p;
};

int main()
{
    S s = { };
    return !s.p;
}
$ $GCC45/bin/g++ -g -Wl,-R$GCC45/lib64 debug2.cc -o out2-45
$ gdb --quiet ./out2-45
Reading symbols from /tmp/out2-45...done.
(gdb) ptype S
type = struct S {
    S::ptr p;
}
(gdb) ptype S::p
type = void *

That type is wrong, it should be S* not void*

GCC 4.4 gets it right, by not tracking the typedef at all:

(gdb) ptype S
type = struct S {
    S *p;
}
(gdb) ptype S::p
type = struct S {
    S *p;
} *


GCC 4.6 tracks the typedef and gets its type right:

(gdb) ptype S
type = struct S {
    S::ptr p;
}
(gdb) ptype S::p
type = struct S {
    S::ptr p;
} *


-- 
           Summary: [4.5 Regression] wrong debug info for nested typedef
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: redi at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44645

Reply via email to