dmd
dmd copied to clipboard
another correction for caller destroying args
This is a fix for this problem:
https://github.com/dlang/dmd/pull/16145#issuecomment-1932776873
In case that PR never gets pulled. Don't know how to trigger the test case without the rest of that PR.
The problem is that functions that return a static array with elements that need to be destructed should not be inlined, because the e2ir.d code no longer will call _d_arrayctor() to do it.
Thanks for your pull request, @WalterBright!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#16167"
This is ready to merge.
does this fix anything? Why does it not have a test suite change?
It's a partial fix for https://github.com/dlang/dmd/pull/16145 . If we don't go with 16415, this fix is still important in case of a change of mind in the future. But it cannot be tested without implementing 16145.
I.e. the code promises that caller/callee destruction is set by a flag in target.d. It should keep its promise!
There's a PR for removing the frontend inliner. #16173