[LLVMbugs] [Bug 104] New: [c++] Rampant type-unsafety for no apparent reason

bugzilla-daemon at zion.cs.uiuc.edu bugzilla-daemon at zion.cs.uiuc.edu
Sat Nov 8 23:07:34 PST 2003


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=104

           Summary: [c++] Rampant type-unsafety for no apparent reason
           Product: tools
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-g++
        AssignedTo: sabre at nondot.org
        ReportedBy: sabre at nondot.org


In this test (test/Regression/C++Frontend/2003-11-09-ConstructorTypeSafety.cpp.tr):

---
struct contained {
  unsigned X;
  contained();
};

struct base {
  unsigned A, B;
};

struct derived : public base {
  contained _M_value_field;
};

int test() {
  derived X;
}
--- 

There are lots of type safety problems.  For example, the types are compiled to:

        %struct.base = type { uint, uint }
        %struct.contained = type { uint }
        %struct.derived = type { ubyte, ubyte, ubyte, ubyte, ubyte, ubyte,
ubyte, ubyte, %struct.contained }

instead of:
        %struct.derived = type { %struct.base, %struct.contained }

Ugh.  Of course, this is nuking all of my attempts at working on data-structure
based programs.  :(

-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list