[Issue 17897] Incorrect number of destructor calls in example

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 13 14:58:26 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17897

--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I don't know if it's in the spec or not, but clearly, there is no reason for
the temporary not to be constructed in-place on the stack for passage into fun.
It does not need to construct it and then make a copy, that would be wasteful.

Yes, the ultimate guarantee is that the number of postblits/ctor calls must
equal the number of dtor calls. But the bug is definitely that an extra dtor
call is made.

Compiling with -vcg-ast shows no such call, I only see one. The extra dtor is
completely erroneous.

--


More information about the Digitalmars-d-bugs mailing list