#include <cstdio>
struct A {
A() { std::printf("A::A() this=%p\n", this); }
~A() { std::printf("A::~A() this=%p\n", this); }
};
struct B : A {
B(int) { std::printf("B::B(int) this=%p\n", this); }
B() : B(1) { std::printf("B::B() this=%p\n", this); throw 1; }
~B() { std::printf("B::~B() this=%p\n", this); }
};
int main()
try {
B b;
}
catch (...) {
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KCnN0cnVjdCBBIHsKICBBKCkgeyBzdGQ6OnByaW50ZigiQTo6QSgpIHRoaXM9JXBcbiIsIHRoaXMpOyB9CiAgfkEoKSB7IHN0ZDo6cHJpbnRmKCJBOjp+QSgpIHRoaXM9JXBcbiIsIHRoaXMpOyB9Cn07CgpzdHJ1Y3QgQiA6IEEgewogIEIoaW50KSB7IHN0ZDo6cHJpbnRmKCJCOjpCKGludCkgdGhpcz0lcFxuIiwgdGhpcyk7IH0KICBCKCkgOiBCKDEpIHsgc3RkOjpwcmludGYoIkI6OkIoKSB0aGlzPSVwXG4iLCB0aGlzKTsgdGhyb3cgMTsgfQogIH5CKCkgeyBzdGQ6OnByaW50ZigiQjo6fkIoKSB0aGlzPSVwXG4iLCB0aGlzKTsgfQp9OwoKaW50IG1haW4oKQp0cnkgewogIEIgYjsKfQpjYXRjaCAoLi4uKSB7CiAgcmV0dXJuIDA7Cn0K