Compiler Error C3246
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3246.
class' : cannot inherit from 'type' as it has been declared as 'sealed'
A class that is marked as sealed cannot be the base class for any other classes.
The following sample generates C3246:
// C3246_2.cpp
// compile with: /clr /LD
ref class X sealed {};
ref class Y : public X {}; // C3246
The following sample generates C3246:
// C3246.cpp
// compile with: /clr:oldSyntax /LD
#using <mscorlib.dll>
__sealed __gc class X {};
__gc class Y : public X {}; // C3246
Show: