Files
codeql/cpp/ql/test/library-tests/syntax-zoo/try_catch.cpp
2019-08-06 14:10:25 +02:00

26 lines
353 B
C++

namespace std {
struct exception {
virtual ~exception();
};
}
struct exn1 : std::exception { };
struct exn2 : std::exception { };
void bypass_catch() {
try {
throw exn1();
} catch (const exn2 &e) {
return;
}
}
void throw_from_nonstmt(int select) {
if (select) {
int x = (throw 1, 2);
} else {
({ throw 3; });
}
}