[LLVMbugs] [Bug 14467] New: debug info types with no mentioned members

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 30 12:06:22 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=14467

             Bug #: 14467
           Summary: debug info types with no mentioned members
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: googler
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dblaikie at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
            Blocks: 14330
    Classification: Unclassified


GCC produces debug info for member variables even when they're not directly
mentioned in the source:

struct foo {
  int i;
};

void func() {
  static foo* f = new foo();
}

GCC produces debug info for 'foo' (note: if you remove the nested type (& the
'n' static variable) GCC stops producing debug info for 'foo'), including the
unmentioned 'i' member.

Clang produces no debug info for 'foo' in the above example.
If you add code that mentions a member variable then all the member variables
are emitted.
If you add a nested type to 'foo' and then mention that type then debug info
for 'foo' (but not its member variable 'i') and 'foo::bar' are emitted.

This isn't strictly a bug, perhaps (hence filed as "enhancement") but fails the
GDB test suite. If this is resolved as "not a bug", please adjust the test
suite to be resilient to this (possibly by adding a reference to 'i' to cause
the debug info to be emitted).

GCC does emit the same kind of fieldless debug info (for the outer class) if
you instantiate the inner class but not the outer class. So that in and of
itself isn't necessarily wrong (or at least there is precedence for its
wrongness)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list