1 // PR c++/61982 2 // { dg-additional-options "-O2 -fdump-tree-optimized -fdelete-null-pointer-checks" } 3 // { dg-final { scan-tree-dump-not "= 0" "optimized" } } 4 5 struct X { 6 int i; clearX7 void clear() { i = 0; } 8 }; 9 f(X * x)10void f(X* x) { 11 x->clear(); 12 x->~X(); 13 } 14 g(X * x)15void g(X* x) { 16 x->clear(); 17 delete x; 18 } 19