Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C3420

Error Message

'finalizer' : a finalizer cannot be virtual

A finalizer can only be called non-virtually from its enclosing type. Therefore, it is an error to declare a virtual finalizer.

For more information, see Destructors and Finalizers in Visual C++.

Example

The following sample generates C3420.

// C3420.cpp
// compile with: /clr /c
ref class R {
   virtual !R() {}   // C3420
};
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.