1 // { dg-do run { target c++11 } } 2 // PR82560, failed to destruct default arg inside new 3 4 static int liveness = 0; 5 6 struct Foo { 7 FooFoo8 Foo (int) { 9 liveness++; 10 } 11 ~FooFoo12 ~Foo() { 13 liveness--; 14 } 15 16 }; 17 18 struct Bar { 19 Bar (Foo = 0) { } ~BarBar20 ~Bar() { } 21 }; 22 main()23int main() 24 { 25 delete new Bar(); 26 27 return liveness != 0;; 28 } 29