Considering that a virtual call of a T
member function (directly or indirectly) from a constructor of a class T
, can at most go down to T
's implementation, does the following code, with unqualified call, have Undefined Behavior or not?
Note, to avoid noise: if you believe that member functions are not called virtually when invoked from a constructor, then please don't answer or comment here, but raise that issue in a separate SO question. Thank you.
struct Baze
{
virtual void foo();
virtual void bar() = 0;
Baze(){ foo(); bar(); }
};
void Baze::foo() {}
void Baze::bar() {}
struct Derived: Baze
{
void bar() override {}
};
int main()
{
Derived{};
}