-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[cxx-interop] implicitly imported CxxShim module should not force cli… #65875
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-ci please test |
|
@swift-ci please test source compatibility |
egorzhdan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would libcxxstdlibshim.h also require a similar fix?
No, the compiler doesn't implicitly add it as an import when C++ interop is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a less intrusive way to fix this: can we make the implicit import of CxxShim @_implementationOnly?
In Frontend.cpp:
if (Invocation.getLangOptions().EnableCXXInterop && canImportCxxShim()) {
pushImport(CXX_SHIM_NAME, {ImportFlags::ImplementationOnly});
}
That way IIUC the compiler would also refuse to compile such modules with cross-module optimization enabled instead of crashing.
|
Yes, I can try that. |
…ent modules to enable C++ interoperability Fixes swiftlang#65831
b30b61a to
b17ade9
Compare
|
@swift-ci please test |
|
@swift-ci please test source compatibility |
|
@egorzhdan updated :) |
…ent modules to enable C++ interoperability
Fixes #65831