We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Compiler Error C3662

'member' : override specifier 'specifier' only allowed on member functions of managed classes

An override specifier was used on a member of native type, which is not allowed.

For more information, see Explicit Overrides.

The following sample generates C3662.

// C3662.cpp
// compile with: /clr /c
struct S {
   virtual void f();

struct S1 : S {
   virtual void f() new;   // C3662

ref struct T {
   virtual void f();

ref struct T1 : T {
   virtual void f() new;   // OK