[C++ PATCH 82560] missing dtor call
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr82560.C
blob3408bae518e5660cee7808b36993e27b82c99645
1 // { dg-do run { target c++11 } }
2 // PR82560, failed to destruct default arg inside new
4 static int liveness = 0;
6 struct Foo {
8   Foo (int) {
9     liveness++;
10   }
12   ~Foo() {
13     liveness--;
14   }
18 struct Bar {
19   Bar (Foo = 0) { }
20   ~Bar() { }
23 int main()
25   delete new Bar();
27   return liveness != 0;;