// { dg-do run } #include #include struct Foo { virtual void f() {} }; int main(int argc, char**) { std::auto_ptr foo; if (argc >= 0) { foo.reset(new Foo()); } else { std::vector v; } Foo* p = foo.release(); p->f(); }