Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge stable into master #12408

Merged
merged 13 commits into from Apr 9, 2021
Merged

Conversation

MoonlightSentinel
Copy link
Contributor

Just to resolve some merge conflicts up front and sync the changes e.g. to escape.d.

MoonlightSentinel and others added 12 commits March 15, 2021 02:02
The code may never throw exceptions in betterC mode, so it cannot abort
the ctor with an uncaught exception.
…y/dtor call (dlang#12265)

* Issue 21693 - Lower scoped destruction of extern(C++) class to destroy

Ensures proper RAII behaviour for stack allocated instances but doesn't
affect the behaviour for heap allocated instances.

The previous rewrite used `delete` which relies on `TypeInfo` and
crashed at runtime. Using `object.destroy` circumvents this issue (and
is also beneficial due to the deprecation of `delete`).

`destroy` can be used instead of `delete` because the instances live on
the heap and hence don't need to be deallocated.
Co-authored-by: Johan Forsberg <johan.forsberg@akerstroms.se>
dlang#12302)

* Fix issue 19192 - [wrong-code] [crashes] Covariant method interface <- abstract class <- class hierarchies

While analyzing covariant methods, dmd semantic analyzer searched for
immediate interfaces of the class that may have a vtbl entry matching
the method. This failed for possible scenarios where the covariant
method may be declared in an interface inheritance of an abstract base
class.

The fix adds a for loop that iterates over the base classes to find
the relevant interface with matching vtbl entry.
…ecision

These tests have regressed on Linux/AArch64 since dlang#12164.
Skip temporaries for `void` expressions and defer error messages to
further semantic analysis.
The previous .cpp code was GNU-specific and required something like
`-std=gnu++11` to compile with clang. Switch to C++11 and initializer
lists instead.
…sses

Iterate the inheritance chain for `extern(D)` classes to emulate the
manual chaining implemented in `rt_finalise`.
...in class methods.

The checks for such slices relied on `va` while actually just caring
about the current type. This was broken by [1] which clears `va` for
class members to detect escapes of delegates.

This also applied to the checks for struct temporaries/literals.

[1] dlang#8008
Because the `union` is initialised when one of its members has been
constructed.
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
19192 blocker [wrong-code] [crashes] Covariant method interface <- abstract class <- class hierarchies
20705 blocker \-preview=rvaluerefparam does not work with template deduction
21229 regression [REG 2.080.2] Constructor flow analysis doesn't understand unions
21687 regression Confusing error message for CTFE pointer in static initializer
21693 major extern(C++) class instance dtors are never called, breaking RAII
21709 regression std.conv.emplace not usable in betterC - 2.096
21798 regression checkaction=context creates temporary of type void
21799 critical CTFE doesn't call base class destructor for extern(D) classes
21807 regression Non-immutable data can be converted to immutable using function call in ctor

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#12408"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants