Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C2687

'type' : exception-declaration cannot be 'void' or denote an incomplete type or pointer or reference to an incomplete type

For a type to be part of an exception declaration, it must be defined and not void.

The following sample generates C2687:

// C2687.cpp
class C;

int main() {
   try {}
   catch (C) {}   // C2687 error
}

Possible resolution:

// C2687b.cpp
// compile with: /EHsc
class C {};

int main() {
   try {}
   catch (C) {}
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.