Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'derived_class': Object layout under
/vd2will change due to virtual base 'base_class'
Remarks
This warning is off by default. For more information, see Compiler Warnings That Are Off by Default.
Under the default compile option of /vd1, the derived class doesn't have a vtordisp field for the indicated virtual base. If /vd2 or #pragma vtordisp(2) is in effect, a vtordisp field is present, changing the object layout. This difference can lead to binary compatibility problems if interacting modules are compiled with different vtordisp settings.
Example
The following example generates C4435.
// C4435.cpp
// compile with: /c /W4
#pragma warning(default : 4435)
class A
{
public:
virtual ~A() {}
};
class B : public virtual A // C4435
{};