Open
Description
In MSVC, constructors of virtual classes take an argument that indicates whether or not to instantiate virtual bases. This literally results in a conditional jump. This is telling in multiple ways.
-
I believe it indicates that the method must be a constructor. I think (must have not tested) that if the virtual constructor is inlined, the compiler will always know if the argument is set or not, and so the branch will be removed. Here is an example: https://godbolt.org/z/114bhe93x
-
Any vftable installation that occurs in the init vbase branch obviously doesn't belong to us.
Here is a simple example where on line 72 C0::vftable is a vftable on the virtual base C0 that is installed in the branch: https://godbolt.org/z/PzdoznMqz