Compiler Error C2490

 

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 C2490.

keyword' not allowed in function with 'naked' attribute

A function defined as naked cannot use structured exception handling.

The following sample generates C2490:

// C2490.cpp  
// processor: x86  
__declspec( naked ) int func() {  
   __try{}   // C2490, structured exception handling  
}  

Show: