2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr33572.C
blobb4db2ac662ba277ade1a495b8434d56386e29a1d
1 // { dg-do run }
2 // { dg-options "-std=c++98" }
4 #include <vector>
5 #include <memory>
7 struct Foo { virtual void f() {} };
9 int main(int argc, char**)
11         std::auto_ptr<Foo> foo;
12         if (argc >= 0) {
13                 foo.reset(new Foo());
14         } else {
15                 std::vector<int> v;
16         }
17         Foo* p = foo.release();
18         p->f();