[Issue 17897] Incorrect number of destructor calls in example
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 13 14:42:48 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17897
--- Comment #7 from Jack Applegame <japplegame at gmail.com> ---
(In reply to Steven Schveighoffer from comment #5)
> The bug in the example is that the destructor is called twice, not that
> postblit is not called.
Not exactly. In fact, it is important that the number of constructor calls was
equal to the number of destructors calls (as Richard said). So this bug can be
interpreted as missed postblit or extra destructor.
I believe that the compiler is free to choose to make a copy or not.
Or am I mistaken and the exact behavior is somewhere in specs?
--
More information about the Digitalmars-d-bugs
mailing list