static_cast
downcast on a virtual base class
Not really... Now about my misconception: I thought that A
in the following was a virtual base class when in fact it's not; it's, according to 10.3.1, a polymorphic class. Using static_cast
here seems to be fine.
struct B { virtual ~B() {} };
struct D : B { };
In summary, yes, this is a dangerous pitfall.