swift icon indicating copy to clipboard operation
swift copied to clipboard

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

Open hyp opened this issue 2 years ago • 2 comments

…ec if needed when emitting C++ constructor call

Fixes https://github.com/apple/swift/issues/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: https://github.com/apple/swift/pull/65922

hyp avatar Jun 08 '23 22:06 hyp

@swift-ci please test

hyp avatar Jun 08 '23 22:06 hyp

@swift-ci please test source compatibility

hyp avatar Jun 08 '23 22:06 hyp