[Issue 9335] Dtors are not called for dynamic arrays initialized by literals
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 28 07:42:42 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9335
--- Comment #8 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-06-28 07:42:41 PDT ---
(In reply to comment #4)
>
> There is no need to call the destructor or postblit when moving the stack
> allocated structs to the heap, it is legal to move them with memcpy.
Issue here is not in non-calling destructor when object is moved from stack to
heap by pointer but is in non-calling destructor for temporary. This
contradicts to policy in issue 9334 (which is itself not stable).
General problem here is that dmd (unexpectedly) sometimes initializes variables
with temporaries and sometimes not. When it does initialize objects with a
temporary, sometimes it calls destructors on it and sometimes not. Such game
with temporaries and destructors causes bugs.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list