summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr20458.C
blob: d4e7d1a1a86fa97eb0c83ea7bf3de10ca09e39d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do run } */
/* { dg-options "-O2" } */

/* The tail call optimization would inapproriately tail call the 
   destructors due to not recognizing a call clobbered variable */
namespace std
{
	class locale
	{
		public:
			locale();
			~locale();
	};
}

struct B
{
	std::locale _M_buf_locale;
	virtual ~B() {}
};

struct C : public B
{
	char *s;
};

void foo ()
{
	C c;
}

int main()
{
	foo ();
	return 0;
}