Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 889 Bytes

compiler-error-c2694.md

File metadata and controls

31 lines (26 loc) · 889 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2694
Compiler Error C2694
11/04/2016
C2694
C2694
8dc2cec2-67ae-4e16-8c0c-374425aca8bc

Compiler Error C2694

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