Condividi tramite


Errore del compilatore C2318

nessun blocco try associato a questo gestore catch

Osservazioni:

Un gestore catch è stato definito, ma non è preceduto da un blocco try .

Example

L'esempio seguente genera l'errore C2318:

// C2318.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   // no try block
   catch( int ) {}   // C2318
}

Possibile soluzione:

// C2318b.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   try{}
   catch( int ) {}
}