Compiler Warning (level 4) C4674

'identifier' : the destructor is inaccessible

A user-defined destructor for the specified thrown object is not accessible. The object cannot be destroyed after it is thrown. Check that the destructor has public access.

The following example causes this warning;

class C
{
    ~C();    // destructor has private access by default
} c;

void main()
{
    try
    {
       throw c;
    }
    catch( C )    // warning
    {
    }
}