Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 972 Bytes

compiler-error-c3665.md

File metadata and controls

31 lines (25 loc) · 972 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3665
Compiler Error C3665
11/04/2016
C3665
C3665
893bb47e-8de1-43aa-af7d-fa47ad149ee9

Compiler Error C3665

'destructor' : override specifier 'keyword' not allowed on a destructor/finalizer

A keyword was used that is not allowed on a destructor or finalizer.

For example, a new slot cannot be requested on a destructor or finalizer. For more information, see Explicit Overrides and Destructors and finalizers.

The following sample generates C3665:

// C3665.cpp
// compile with: /clr
public ref struct R {
   virtual ~R() { }
   virtual void a() { }
};

public ref struct S : R {
   virtual ~S() new {}   // C3665
   virtual void a() new {}   // OK
};