The standard does not require a call to be made dynamically or statically. Conceptually, this is dynamic, and all quotes regarding the invocation of a virtual function when constructing or destroying an object contain text directly or indirectly. This is important because it entails whether the call is direct to the function or not, should be the same thing. Now consider:
struct A { A() { f(); } void f() { g(); } virtual void g() {}; };
And suppose the code is not displayed and all the usual caveats are so that functions are not included. The definition of A::f() , which may be in another translation unit, does not know whether it is called from the constructor or destructor, or with none of them. He does not know if the complete object has type A or Z for any derived type Z , so he must use dynamic dispatch.
Now the as-if rule means that the compiler has some freedom of action for optimization, and it can decide that in the body of the constructor / destructor (or any function built into it) the final override is known, and it can thus avoid dynamic dispatch and immediately call the known final override. This works even for pure virtual functions, because in this case the behavior is undefined, and therefore there is no guarantee of behavior - therefore, any conversion by the compiler will be in this case.
source share