Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 815 Bytes

compiler-warning-level-4-c4670.md

File metadata and controls

38 lines (32 loc) · 815 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 4) C4670
Compiler Warning (level 4) C4670
11/04/2016
C4670
C4670
e172b134-b1fb-4dfe-8e9d-209ea08b73c7

Compiler Warning (level 4) C4670

'identifier' : this base class is inaccessible

The specified base class of an object to be thrown in a try block is not accessible. The object cannot be instantiated if it is thrown. Check that the base class is inherited with the correct access specifier.

The following sample generates C4670:

// C4670.cpp
// compile with: /EHsc /W4
class A
{
};

class B : /* public */ A
{
} b;   // inherits A with private access by default

int main()
{
    try
    {
       throw b;   // C4670
    }
    catch( B )
    {
    }
}