Skip to content

[5.9][cxx-interop] evaluate default constructor's unevaluated exception sp… #66477

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

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Jun 8, 2023

…ec if needed when emitting C++ constructor call

Fixes #65891

  • Explanation:
    Swift needs to understand if C++ functions are noexcept to elide exception traps. Some C++ class members, like the implicit default constructor, delay the evaluation of exception specifier. This delay causes Swift to crash on an unevaluated exception specifier. The fix forces Swift to evaluate unevaluated exception specifier for a C++ function that has such an unevaluated specifier.
  • Scope: Swift's IRGen, C++ interoperability
  • Risk: Low, these checks are only done when C++ interoperability is enabled , and exceptions are not disabled
  • Testing: Swift unit tests.
  • PR: [cxx-interop] evaluate default constructor's unevaluated exception sp… #65922

…ec if needed when emitting C++ constructor call

Fixes swiftlang#65891

(cherry picked from commit b0dab0b)
@hyp hyp requested a review from a team as a code owner June 8, 2023 22:41
@hyp hyp added c++ interop Feature: Interoperability with C++ swift 5.9 labels Jun 8, 2023
@hyp hyp changed the title [cxx-interop] evaluate default constructor's unevaluated exception sp… [5.9][cxx-interop] evaluate default constructor's unevaluated exception sp… Jun 8, 2023
@hyp
Copy link
Contributor Author

hyp commented Jun 8, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Jun 8, 2023

@swift-ci please test source compatibility

@hyp hyp merged commit 624f553 into swiftlang:release/5.9 Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++ swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants