Compiler Error C2311
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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
© 2015 Microsoft