Compiler Error C2705

 

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

label' : illegal jump into 'exception handler block' scope

Execution jumps to a label within a try/catch, __try/__except, __try/__finally block. For more information, see Exception Handling.

The following sample generates C2705:

// C2705.cpp  
int main() {  
goto trouble;  
   __try {  
      trouble: ;   // C2705  
   }  
   __finally {}  
  
   // try the following line instead  
   // trouble: ;  
}  

Show: