4 void println(const char* s) {
9 struct outer_exception {};
10 struct inner_exception {};
13 void throw_cxx_exception() {
14 if (std::uncaught_exception()) {
15 println("throwing inner C++ exception");
16 throw inner_exception();
18 println("throwing outer C++ exception");
19 throw outer_exception();
23 void cxx_catch_callback(void (*cb)()) {
26 println("unreachable: callback returns");
27 } catch (outer_exception) {
28 println("unreachable: caught outer exception in catch (...)");
29 } catch (inner_exception) {
30 println("unreachable: caught inner exception in catch (...)");