Given this code:
#include
struct A {
};
struct B {
};
struct C {
};
struct E : A {
int field;
};
struct F : A, B {
int field
There is no language rule that says that any particular type needs to have any particular size, with the exception of char
(size 1), and subject to the constraint that complete objects of class type have non-zero size. There is nothing buggy about your particular compiler's way of laying out the types in your example.
As for the new question, after you edited it: It's possible that MSVC just doesn't put a lot of effort into optimising multiple inheritance, because that's a comparatively rare thing that you could argue that there's little pay-off. I don't know anything about the real decision process that went on, but just consider that there may be pragmatic engineering trade-offs like this at play.