1// PR c++/36633
2
3/* { dg-do compile } */
4/* { dg-options "-O2 -Wall -fdump-tree-forwprop1" } */
5// No particular reason for choosing forwprop1 dump to look at.
6
7struct B { ~B() {} };
8struct D : public B {};
9//struct D {};
10
11struct my_deleter
12{
13  void operator()(D * d)
14  {
15    //    delete [] d;
16  }
17};
18
19struct smart_ptr
20{
21  smart_ptr(D * ptr) : p(ptr) { }
22  ~smart_ptr() { d(p); }
23  D * p;
24  my_deleter d;
25};
26
27int
28test01()
29{
30  smart_ptr p(new D[7]);
31
32  return 0;
33}
34
35int main()
36{
37  test01();
38  return 0;
39}
40
41/* { dg-final { scan-tree-dump-not "= .* \\+ -" "forwprop1" } } */
42/* { dg-final { cleanup-tree-dump "forwprop1" } } */
43