#include <iostream>
#include <memory>
struct A
{
~A() { std::cout << "~A\n"; }
};
struct B : A
{
~B() { std::cout << "~B\n"; }
};
int
main()
{
std::shared_ptr<A> a = std::shared_ptr<B>(new B);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWVtb3J5PgoKc3RydWN0IEEKewogICAgfkEoKSB7IHN0ZDo6Y291dCA8PCAifkFcbiI7IH0KfTsKCnN0cnVjdCBCIDogQQp7CiAgICB+QigpIHsgc3RkOjpjb3V0IDw8ICJ+QlxuIjsgfQp9OwoKaW50Cm1haW4oKQp7CiAgICBzdGQ6OnNoYXJlZF9wdHI8QT4gYSA9IHN0ZDo6c2hhcmVkX3B0cjxCPihuZXcgQik7Cn0=