[LLVMbugs] [Bug 18702] New: MS ABI: insufficient padding inserted between zero sized virtual bases in a record with a bitfield

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 2 19:17:00 PST 2014


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

            Bug ID: 18702
           Summary: MS ABI: insufficient padding inserted between zero
                    sized virtual bases in a record with a bitfield
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
extern "C" int printf(const char *, ...);
struct A {};
struct B {};
struct C : virtual A, virtual B {
  int Field : 3;
  C() {
    printf("A: %Iu\n", (char *)(A *)this - (char *)this);
    printf("B: %Iu\n", (char *)(B *)this - (char *)this);
  }
};

int main() { C(); printf("sizeof(C): %Iu\n", sizeof(C)); }

clang gives us:
A: 12
B: 20
sizeof(C): 20

msvc gives:
A: 12
B: 24
sizeof(C): 24

-- 
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/20140203/ca9a9ff9/attachment.html>


More information about the llvm-bugs mailing list