[Issue 24798] Under some circumstances, the compiler destroys the same object more than once
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 10 11:47:43 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24798
--- Comment #3 from kinke <kinke at gmx.net> ---
To be clear, this is no double-destroy issue, as can be seen when printing the
addresses of the destructed instances in the 2nd test case. The problem in the
2nd test case is that `MyMapResult.front()` returns a copy of `er.substs[0]`,
with `er` already having been destructed (due to the actual issue), so it
returns a copy of an `S(99)`, which then gets destructed, and the check then
wrongly complaining about a double-destroy, while in reality it's a destruction
of a copy of a destructed S instance.
--
More information about the Digitalmars-d-bugs
mailing list