269
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Kevin Bealer <Kevin_member@pathlink.com>
|
|
6 // @date@ 2005-02-05
|
1489
|
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2864
|
269
|
8
|
|
9 module dstress.run.destructor_04;
|
|
10
|
800
|
11 bool hadDtor = false;
|
|
12
|
269
|
13 class MyClass{
|
|
14 this(){
|
|
15 throw new Exception("dummy");
|
|
16 }
|
|
17
|
|
18 ~this(){
|
800
|
19 hadDtor = true;
|
756
|
20 throw new Exception("should never throw");
|
800
|
21
|
269
|
22 }
|
|
23 }
|
|
24
|
|
25 int main(){
|
|
26 MyClass c;
|
|
27
|
|
28 try{
|
|
29 c = new MyClass();
|
|
30 }catch{
|
800
|
31 if(!hadDtor){
|
|
32 return 0;
|
|
33 }else{
|
|
34 assert(0);
|
|
35 }
|
269
|
36 }
|
|
37
|
800
|
38 assert(0);
|
269
|
39 }
|