1 2 3 4 5 6 7 8
struct A { }; struct B : A { }; struct C : virtual B { }; int main() { C *c = 0; A *a = c; c = static_cast<C*>(a); }
1 2 3
In function 'int main()': Line 7: error: cannot convert from base 'A' to derived type 'C' via virtual base 'B' compilation terminated due to -Wfatal-errors.