-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add a test documenting the current state of C++ exception handling #30674
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
Conversation
Swift currently allows C++ exceptions to propagate across Swift stack frames, which is wrong; this test documents that, but also the current behaviors that are fine. See also the discussion here: https://forums.swift.org/t/handling-c-exceptions/34823 I'm not sure whether this test will on all platforms, particularly Windows. I may restrict it to certain platforms if build bots show it doesn't work everywhere.
@swift-ci Please smoke test |
@swift-ci Please test Windows |
1 similar comment
@swift-ci Please test Windows |
@swift-ci Please smoke test Windows |
I was hoping that linking So I think I'll have to do the right fix first, which is to make Swift link against the correct library for each platform when Until that's done, I'm not looking for further review on this PR. What is the right way to do this -- just leave this PR open with this comment? (If I close it and reopen a new PR, the previous discussion will be lost, which seems undesirable.) |
We can leave it open while it is blocked. Just make sure to close it should plans change and you decide to take another approach. |
Thanks, will do! |
Also note that there is a third C++ library that you need to be aware of: |
@swift-ci please test Windows platform |
Thanks for the heads-up! As I mention above, I've come to the conclusion that it's really not a sustainable approach to link to all the platform-specific libraries locally in this test. Instead, Swift should generally link against the right C++ libraries when https://bugs.swift.org/browse/SR-12469 I'm pausing this PR until that bug is fixed. |
Swift currently allows C++ exceptions to propagate across Swift stack frames, which is wrong; this test documents that, but also the current behaviors that are fine.
See also the discussion here:
https://forums.swift.org/t/handling-c-exceptions/34823
I'm not sure whether this test will on all platforms, particularly Windows. I may restrict it to certain platforms if build bots show it doesn't work everywhere.