[Issue 17897] Incorrect number of destructor calls in example

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


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

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|Postblit is not called for  |Incorrect number of
                   |temporary structures in the |destructor calls in example
                   |function parameters         |

--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The bug in the example is that the destructor is called twice, not that
postblit is not called.

I assumed you were going to file a bug on the destructor calls, but looks like
this is it, so I'll just change the title.

(In reply to Simen Kjaeraas from comment #4)
> (In reply to Steven Schveighoffer from comment #1)
> As we can see for unittest1, the destructor is called twice - once for the
> temporary in the unittest block, and once when  we exit fun().

No, it's called once for the local in fun, and another time for no reason (an
actual bug). It's still a move.

--


More information about the Digitalmars-d-bugs mailing list