Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 605 Bytes

compiler-error-c2311.md

File metadata and controls

28 lines (24 loc) · 605 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2311
Compiler Error C2311
11/04/2016
C2311
C2311
1aff9bd5-ed0b-4db6-bbc0-01ac89850cf2

Compiler Error C2311

'exception' : is caught by '...' on line number

The catch handler for the ellipsis (...) must be the last handler for a throw.

The following sample generates C2311:

// C2311.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   try {
      throw "ooops!";
   }
   catch( ... ) {}
   catch( int ) {}   // C2311  ellipsis handler not last catch
}