Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Warning (level 4) C4266
Collapse the table of content
Expand the table of content

Compiler Warning (level 4) C4266

Error Message

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

A derived class did not override all overloads of a virtual function.

This warning is off by default. See Compiler Warnings That Are Off by Default for more information.

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);
};

Community Additions

ADD
Show:
© 2015 Microsoft