DIP 1008 Preliminary Review Round 1

Stanislav Blinov via Digitalmars-d digitalmars-d at puremagic.com
Sat May 20 08:05:14 PDT 2017


On Friday, 19 May 2017 at 15:45:28 UTC, Mike Parker wrote:
> Destroy!


> In catch blocks, e is regarded as scope so that it cannot 
> escape the catch block.
> ...
> Code that needs to leak the thrown exception object can clone 
> the object.

There's a contradiction here. Generic cloning cannot be 
implemented without storing exceptions for rethrowing later (in 
case member destructors throw).

Furthermore:

> 2. Disallowing Exception objects with postblit fields.

What about fields with destructors? I detect a double-free. If we 
need to clone, we need postblits and destructors, or neither.

It looks as if that clause is added specifically to deal with 
cloning. Yet no information on cloning implementation is provided.


More information about the Digitalmars-d mailing list