The solution is to make inheritance from class A virtual.
struct C : virtual public A, public B { virtual ~C(void) override { } };
or
struct F : virtual public A, public E { ... }
The problem is most likely related to virtual descriptors in the base classes. Perhaps others can provide more explanation why this works.
As @JamesAdkison pointed out, swapping inherited classes (changing struct C : public A, public B {...} to struct C : public B, public A {...} ) also fixes the problem; therefore, changes struct F : public A, public E { ... } to struct F : public E, public A { ... } . So this seems like an error in MSVC as mentioned by @Josh P.
source share