[Issue 20235] C++ ABI doesn't destruct struct arguments in the callee
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 31 09:09:21 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=20235
--- Comment #6 from Dlang Bot <dlang-bot at dlang.rocks> ---
dlang/dmd pull request #12162 "Issue 20235 - Simplify fix by not declaring
__gate" was merged into master:
- 1c681d504f5b696c09d1755bb3630dc1790c61ff by Martin Kinkelin:
Issue 20235 - Simplify fix by not declaring __gate
Following Martin Kinkelin's comment in PR #12012:
> We have the edtor `=> (__gate || edtor)` rewrite.
> IIRC, the whole point of this `__gate` is to transfer ownership
> of all temporary args requiring destruction to the callee just before the
call
> (i.e., if all arguments were constructed successfully without throw).
> For `extern(D)`, it's up to the callee to destruct the parameter
> [which, low-level wise, is either the original argument passed by ref or a
moved/blitted instance].
>
> So if `callerDestroysArgs == true`, it should suffice to keep the original
`edtor`
> and not declaring+setting `__gate`.
Source: https://github.com/dlang/dmd/pull/12012#event-4259809188
https://github.com/dlang/dmd/pull/12162
--
More information about the Digitalmars-d-bugs
mailing list