Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.22 KB

compiler-warning-level-4-c4266.md

File metadata and controls

49 lines (40 loc) · 1.22 KB
description title ms.date f1_keywords helpviewer_keywords
Learn more about: Compiler Warning (level 4, off) C4266
Compiler Warning (level 4, off) C4266
11/04/2016
C4266
C4266

Compiler Warning (level 4, off) C4266

'function' : no override available for virtual member function from base 'type'; function is hidden

A derived class didn't override all overloads of a virtual function.

This warning is off by default. For more information, see Compiler Warnings That Are Off by Default.

The following sample generates C4266:

// C4266.cpp
// compile with: /W4 /c
#pragma warning (default : 4266)
class Engine {
public:
   virtual void OnException(int&,int);
   virtual void OnException(int&,int&,int);
};

class LocalBinding : private Engine {
   virtual void OnException(int&,int);
};   // C4266

Possible resolution:

// C4266b.cpp
// compile with: /W4 /c
#pragma warning (default : 4266)
class Engine {
public:
   virtual void OnException(int&,int);
   virtual void OnException(int&,int&,int);
};

class LocalBinding : private Engine {
   virtual void OnException(int&,int);
   virtual void OnException(int&, int&, int);
};