'identifier' : bad context for intrinsic function
Structured exception-handling intrinsics are invalid in certain contexts:
To resolve the error, be sure that the exception-handling intrinsics are placed in the appropriate context. The following sample generates C2707:
#include <windows.h> LONG MyFilter() { int x, y; return(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? // C2707 EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH); __try { y = 0; x = 4 / y; return 0; } __except(MyFilter()) { return(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? // ok EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH); } } void main() { }