Compiler Error C2309
catch handler expected a parenthesized exception declaration
A catch handler has no parenthesized type.
The following sample generates C2309:
// C2309.cpp
// compile with: /EHsc
#include <eh.h>
class C {};
int main() {
try {
throw "ooops!";
}
catch C {} // C2309
// try the following line instead
// catch( C ) {}
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for