#include <iostream>
#include <stdlib.h>
class A
{
private:
public:
A()
{
std::cout << "A::A()" << std::endl;
}
~A()
{
throw 1;
std::cout << "A::~A(int)" << std::endl;
}
};
int main()
{
std::set_terminate([](){ std::cout << "terminate called\n"; exit(1);});
A* p = nullptr;
try
{
p = new A();
delete p;
}
catch(...)
{
std::cout << "catch(...)" << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RkbGliLmg+CgpjbGFzcyBBCnsKcHJpdmF0ZToKCnB1YmxpYzoKICAgIEEoKQogICAgewogICAgICAgIHN0ZDo6Y291dCA8PCAiQTo6QSgpIiA8PCBzdGQ6OmVuZGw7CiAgICB9CiAgICB+QSgpCiAgICB7CiAgICAgICAgdGhyb3cgMTsKICAgICAgICBzdGQ6OmNvdXQgPDwgIkE6On5BKGludCkiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KfTsKCgoKaW50IG1haW4oKQp7CgogICAgc3RkOjpzZXRfdGVybWluYXRlKFtdKCl7IHN0ZDo6Y291dCA8PCAidGVybWluYXRlIGNhbGxlZFxuIjsgZXhpdCgxKTt9KTsKCiAgICBBKiBwID0gbnVsbHB0cjsKCiAgICB0cnkKICAgIHsKICAgICAgICBwID0gbmV3IEEoKTsKICAgICAgICBkZWxldGUgcDsKICAgIH0KICAgIGNhdGNoKC4uLikKICAgIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgImNhdGNoKC4uLikiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KCiAgICByZXR1cm4gMDsKfQo=