http://llvm.org/bugs/show_bug.cgi?id=18277
Bug ID: 18277
Summary: [-cxx-abi microsoft] vtordisps for virtual base should
be placed before aligning virtual bases
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
$ cat t.cpp
struct A {
virtual ~A();
long long ll;
};
struct B : A {
virtual ~B();
virtual void foo();
int b;
};
struct C : virtual B {
virtual ~C();
virtual void foo();
};
extern "C" int printf(const char *, ...);
int main() {
printf("sizeof(C): %d\n", sizeof(C));
}
$ cl -nologo t.cpp -GR- && ./t.exe
t.cpp
sizeof(C): 32
$ clang-cl t.cpp -GR- && ./t.exe
sizeof(C): 40
*** Dumping AST Record Layout
0 | struct C
0 | (C vbtable pointer)
... This padding here is unnecessary, and I assume that MSVC doesn't add it
12 | (vtordisp for vbase B)
16 | struct B (virtual base)
16 | struct A (primary base)
16 | (A vftable pointer)
24 | long long ll
32 | int b
| [sizeof=40, align=8
| nvsize=4, nvalign=4]
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs