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 ~BB7struct B { ~B() {} }; 8 struct D : public B {}; 9 //struct D {}; 10 11 struct my_deleter 12 { operatormy_deleter13 void operator()(D * d) 14 { 15 // delete [] d; 16 } 17 }; 18 19 struct smart_ptr 20 { smart_ptrsmart_ptr21 smart_ptr(D * ptr) : p(ptr) { } ~smart_ptrsmart_ptr22 ~smart_ptr() { d(p); } 23 D * p; 24 my_deleter d; 25 }; 26 27 int test01()28test01() 29 { 30 smart_ptr p(new D[7]); 31 32 return 0; 33 } 34 main()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