-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Make isVisibleFromModule accept TagDecl definitions that were demoted to declarations. #41144
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
… to declarations. Clang AST requires to have only a single definition in a redeclaration chain, that's why it demotes duplicate definitions from other modules to declarations. But on the Swift side it is important to know a module contains a full definition and not just a forward declaration, even if it was demoted to a declaration.
Please test with following PR: @swift-ci Please test |
I'm not sure what kind of extra testing is required as this change is supposed to preserve the existing behavior. Any feedback about that is welcome. For now I'm testing with clang change against |
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.
That fix brings me hope, thank you!
Could the test modified in #40091 be updated to test this? |
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.
Yeah, I think this looks good. I agree with @xymus on fixing the test.
Yep, I can totally revert the change in #40091. Just to clarify my understanding, in what cases the test should have failed? Because all PR tests succeed but I'm not sure which ones run "ClangImporter/overlay.swift". |
The test uses |
…in 2 modules" This reverts commit c8c3f9b. With `isThisDeclarationADemotedDefinition` flag we expect the same struct to be available in multiple modules.
Thanks for the explanation! Totally missed that |
Please test with following PR: @swift-ci Please test |
|
@swift-ci Please test |
Clang AST requires to have only a single definition in a redeclaration
chain, that's why it demotes duplicate definitions from other modules to
declarations. But on the Swift side it is important to know a module
contains a full definition and not just a forward declaration, even if
it was demoted to a declaration.