[LLVMbugs] [Bug 17816] New: [-cxx-abi] Wrong class layout in the presence of vbtables/vftables

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 5 06:29:52 PST 2013


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

            Bug ID: 17816
           Summary: [-cxx-abi] Wrong class layout in the presence of
                    vbtables/vftables
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

-------------
struct A { int a; };
struct B { int b; };
struct C { int c; };
struct D : virtual A { int d; };
struct E : virtual B {
  virtual void foo();  // Issues a vfptr.
  int e;
};
struct F: virtual C, D, E { int f; };
F f;
---------------
As of r194076, it results in the following layout:
   0 | struct F
  12 |   struct D (base)
  12 |     (D vbtable pointer)
  16 |     int d
   0 |   struct E (primary base)
   0 |     (E vftable pointer)
   4 |     (E vbtable pointer)
   8 |     int e
  20 |   int f
  24 |   struct C (virtual base)
  24 |     int c
  28 |   struct A (virtual base)
  28 |     int a
  32 |   struct B (virtual base)
  32 |     int b

However, the nvbase E should be laid out before nvbase D.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131105/e2ec6b0d/attachment.html>


More information about the llvm-bugs mailing list