-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[SE-0495] Make sure we can find imported C functions for @c @implementation #84676
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
[SE-0495] Make sure we can find imported C functions for @c @implementation #84676
Conversation
…tation @c @implementation relies on matching the original C declaration. The lookup for the original C declaration was doing the wrong kind of lookup, meaning that it could only find the C declaration if it came through a bridging header, and not through a normal module import. Using unqualified lookup here finds the name appropriately. Clarify the diagnostics here as well to not talk about umbrella and bridging headers. Fixes rdar://161909754.
@swift-ci please smoke test |
@swift-ci please smoke test Linux |
@swift-ci please smoke test macOS |
@swift-ci please smoke test Linux |
@swift-ci please smoke test macOS |
1 similar comment
@swift-ci please smoke test macOS |
@swift-ci please smoke test Linux |
UnqualifiedLookupOptions options = | ||
UnqualifiedLookupFlags::IgnoreAccessControl; | ||
UnqualifiedLookupDescriptor descriptor( | ||
DeclNameRef(ctx, Identifier(), swiftName), func->getDeclContext(), |
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.
Nit: You should be able to get away with just DeclNameRef(swiftName)
here.
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.
Ah, ok.
@swift-ci please smoke test macOS |
@swift-ci please smoke test Linux |
@c @implementation relies on matching the original C declaration. The lookup for the original C declaration was doing the wrong kind of lookup, meaning that it could only find the C declaration if it came through a bridging header, and not through a normal module import. Using unqualified lookup here finds the name appropriately.
Clarify the diagnostics here as well to not talk about umbrella and bridging headers.
Fixes rdar://161909754.