aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/torture/pr33572.C
blob: 91cd073fd229e2e62b1fe8b9bb7571e9c27a1042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do run }
#include <vector>
#include <memory>

struct Foo { virtual void f() {} };

int main(int argc, char**)
{
	std::auto_ptr<Foo> foo;
	if (argc >= 0) {
		foo.reset(new Foo());
	} else {
		std::vector<int> v;
	}
	Foo* p = foo.release();
	p->f();
}