www.digitalmars.com         C & C++   DMDScript  

D - [BUG] assert() in dtor causes access violation

reply Sark7 <sark7 mail333.com> writes:
[code]
class A {
   ~this() { assert(false); }
}
void main() {
   A a = new A();
}
[/code]

In static dtor assert() causes AV too.
Apr 25 2004
parent reply "Walter" <walter digitalmars.com> writes:
Are you sure you're seeing an access violation, or are you seeing an
uncaught exception?

"Sark7" <sark7 mail333.com> wrote in message
news:opr60vkie1ut8jae news.digitalmars.com...
 [code]
 class A {
    ~this() { assert(false); }
 }
 void main() {
    A a = new A();
 }
 [/code]

 In static dtor assert() causes AV too.

Apr 25 2004
parent Sark7 <sark7 mail333.com> writes:
On Sun, 25 Apr 2004 11:38:50 -0700, Walter <walter digitalmars.com> wrote:
 Are you sure you're seeing an access violation, or are you seeing an
 uncaught exception?

Hmm... sorry, it is a uncaught exception. I have been mangled with different behaivour of assert() in ctor & dtor. Why in ctor exception is handled by default, but in dtor it is not? Spec says nothing about that. Thanks.
Apr 26 2004