Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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
}

Community Additions

ADD
Show:
© 2015 Microsoft