Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.23 KB

compiler-warning-level-4-c4435.md

File metadata and controls

37 lines (28 loc) · 1.23 KB
description title ms.date f1_keywords helpviewer_keywords
Learn more about: Compiler Warning (level 4, off) C4435
Compiler Warning (level 4, off) C4435
1/22/2025
C4435
C4435

Compiler warning (level 4, off) C4435

'derived_class': Object layout under /vd2 will change due to virtual base 'base_class'

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 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

vtordisp
/vd (Disable Construction Displacements)