| 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 |
|
| 7 |
struct B { ~B() {} }; |
| 8 |
struct D : public B {}; |
| 9 |
//struct D {}; |
| 10 |
|
| 11 |
struct my_deleter |
| 12 |
{ |
| 13 |
void operator()(D * d) |
| 14 |
{ |
| 15 |
// delete [] d; |
| 16 |
} |
| 17 |
}; |
| 18 |
|
| 19 |
struct smart_ptr |
| 20 |
{ |
| 21 |
smart_ptr(D * ptr) : p(ptr) { } |
| 22 |
~smart_ptr() { d(p); } |
| 23 |
D * p; |
| 24 |
my_deleter d; |
| 25 |
}; |
| 26 |
|
| 27 |
int |
| 28 |
test01() |
| 29 |
{ |
| 30 |
smart_ptr p(new D[7]); |
| 31 |
|
| 32 |
return 0; |
| 33 |
} |
| 34 |
|
| 35 |
int main() |
| 36 |
{ |
| 37 |
test01(); |
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
/* { dg-final { scan-tree-dump-not "= .* \\+ -" "forwprop1" } } */ |