在行“number”上开始的“try”块没有 catch 处理程序
try
块至少须具有一个 catch 处理程序。
以下示例生成 C2317:
// C2317.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
try {
throw "throw an exception";
}
// C2317, no catch handler
}
可能的解决方法:
// C2317b.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
try {
throw "throw an exception";
}
catch(char*) {}
}