Error del compilador C2318
no hay ningún bloque try asociado a este controlador de tipo catch
Un controlador catch
está definido pero no va precedido de un bloque try
.
El ejemplo siguiente genera la advertencia C2318:
// C2318.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
// no try block
catch( int ) {} // C2318
}
Posible solución:
// C2318b.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
try{}
catch( int ) {}
}