Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/pr82560.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 | |
8 Foo (int) { | |
9 liveness++; | |
10 } | |
11 | |
12 ~Foo() { | |
13 liveness--; | |
14 } | |
15 | |
16 }; | |
17 | |
18 struct Bar { | |
19 Bar (Foo = 0) { } | |
20 ~Bar() { } | |
21 }; | |
22 | |
23 int main() | |
24 { | |
25 delete new Bar(); | |
26 | |
27 return liveness != 0;; | |
28 } |