Compiler Error C2353

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2353.

exception specification is not allowed

Exception specifications are not allowed on member functions of managed classes.

The following sample generates C2353:

// C2353.cpp  
// compile with: /clr /c  
ref class X {  
   void f() throw(int);   // C2353  
   void f();   // OK  
};  

Show: