Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
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.

Compiler Error C2694

Error Message

'override': overriding virtual function has less restrictive exception specification than base class virtual member function 'base'

A virtual function was overridden, but under /Za, the overriding function had a less restrictive exception specification.

The following sample generates C2694:

// C2694.cpp
// compile with: /Za /c
class MyBase {
public:
   virtual void f(void) throw(int) {
   }
};

class Derived : public MyBase {
public:
   void f(void) throw(...) {}   // C2694
   void f2(void) throw(int) {}   // OK
};

Community Additions

ADD
Show:
© 2015 Microsoft