Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 882 Bytes

compiler-warning-level-1-c4374.md

File metadata and controls

38 lines (31 loc) · 882 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 1) C4374
Compiler Warning (level 1) C4374
11/04/2016
C4374
C4374
4ac9aaec-d815-4b6e-825f-fa872092dd3b

Compiler Warning (level 1) C4374

'function1': interface method will not be implemented by non-virtual method 'function2'

The compiler expected to find the virtual keyword on a method definition.

The following sample generates C4374:

// C4374.cpp
// compile with: /clr /W1 /c /WX
public interface class I {
   void f();
};

public ref struct B {
   void f() {
      System::Console::WriteLine("B::f()");
   }
};

public ref struct C {
   virtual void f() {
      System::Console::WriteLine("C::f()");
   }
};

public ref struct D : B, I {};   // C4374
public ref struct E : C, I {};   // OK