Compiler Error C2695
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C2695

Error Message

'function1': overriding virtual function differs from 'function2' only by calling convention

The signature of a function in a derived class cannot override a function in a base class and change the calling convention.

The following sample generates C2695:

// C2695.cpp
class C {
   virtual void __fastcall func();

class D : public C {
   virtual void __clrcall func();   // C2695
© 2015 Microsoft