GCC ensures that the first base class is at a zero offset in the layout of the derived class. Therefore, in this case, it is enough to align the derived object.
I cannot find a good link at the moment, but see here in the -wABI section where they describe an exception for an undefined rule: if the base is empty, it may not be zero.
I assume that there will be another exception if the first base does not have a vtable, but the derived object has one. array falling into this category, I would look. Of course, the standard leaves the layout unspecified: Β§10 / 3.
source share