Compiler Warning (level 4) C4435
'class1' : Object layout under /vd2 will change due to virtual base 'class2'
This warning is off by default. See Compiler Warnings That Are Off by Default for more information.
Under the default compile option of /vd1, the derived class does not have a vtordisp
field for the indicated virtual base. If /vd2 or #pragma vtordisp(2)
is in effect, a vtordisp
field will be present, changing the object layout. This can lead to binary compatibility problems if interacting modules are compiled with different vtordisp
settings.
Example
The following sample generates C4435.
// C4435.cpp
// compile with: /c /W4
#pragma warning(default : 4435)
class A
{
public:
virtual ~A() {}
};
class B : public virtual A // C4435
{};
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för