Compiler Warning (level 3) C4292

'name' : 'name' is ambiguous or inaccessible; memory will not be freed if initialization throws an exception

Because an exception could happen while creating an instance of an object, the object’s destructor must be accessible and unambiguous. If it is not, the object will not be deleted correctly. You can avoid this problem by changing the access of the object’s delete operator or compiling without exception handling (/GX–).

The following example shows an inaccessible destructor:

// compiled with (/GX)
class B {
public:
    void *operator new(unsigned int);
};

class D : public B {
protected:
    void operator delete(void *);
};

class E : public D {
public:
    E();
    ~E();
};

void f()
{
    E *pE = new E; // warning C4292, delete is inaccessible (protected)
}