No, they are still treated as virtual, but the dynamic type is that of the class that defined the constructor/destructor whose body is currently being executed. Consider the output of the following code:Virtual function calls would allow exactly that, so within constructors and destructors, calls to the object's member functions are all treated as non-virtual.
struct A {
void non_virtual_func() { std::cout << "A::non_virtual_func()\n"; }
virtual void virtual_func() { std::cout << "A::virtual_func()\n"; }
};
struct B : A {
B() {
A * a = this;
a->non_virtual_func();
a->virtual_func();
}
void non_virtual_func() { std::cout << "B::non_virtual_func()\n"; }
virtual void virtual_func() { std::cout << "B::virtual_func()\n"; }
};
struct C : B {
C() {
A * a = this;
a->non_virtual_func();
a->virtual_func();
}
void non_virtual_func() { std::cout << "C::non_virtual_func()\n"; }
virtual void virtual_func() { std::cout << "C::virtual_func()\n"; }
};
int main(int, char **) {
B b;
std::cout << std::endl;
C c;
std::cout << std::endl;
return 0;
}