# HG changeset patch # User thomask # Date 1107644020 0 # Node ID 281520e4cf9e322c0c084437693d9fc3ab37345f # Parent 84270944834c53343c10ca94d4aaf348685980b9 dtor called after exception in thrown in the ctor Kevin Bealer 2005-02-05 news:cu1m3r$13b4$1@digitaldaemon.com diff -r 84270944834c -r 281520e4cf9e run/destructor_04.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/destructor_04.d Sat Feb 05 22:53:40 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Kevin Bealer +// @date@ 2005-02-05 +// @uri@ news:cu1m3r$13b4$1@digitaldaemon.com + +module dstress.run.destructor_04; + +class MyClass{ + this(){ + throw new Exception("dummy"); + } + + ~this(){ + assert(0); + } +} + +int main(){ + MyClass c; + + bool caught=false; + try{ + c = new MyClass(); + }catch{ + caught=true; + } + + assert(caught); + + return 0; +}