Skip to content

Conversation

egorzhdan
Copy link
Contributor

This change makes sure that NSNotification.Name.NEVPNStatusDidChange is imported correctly when C++ interop is enabled.

importer::findSwiftNewtype is called while writing Clang modules, at a point when the translation-unit scope does not exist (clangSema.TUScope is nullptr).

That prevents the Clang lookup from discovering NSNotificationName declaration.

Instead of trying to pass a translation-unit scope to Clang, let's use qualified name lookup which does not require a scope.

rdar://112199372

This change makes sure that `NSNotification.Name.NEVPNStatusDidChange` is imported correctly when C++ interop is enabled.

`importer::findSwiftNewtype` is called while writing Clang modules, at a point when the translation-unit scope does not exist (`clangSema.TUScope` is `nullptr`).

That prevents the Clang lookup from discovering `NSNotificationName` declaration.

Instead of trying to pass a translation-unit scope to Clang, let's use qualified name lookup which does not require a scope.

rdar://112199372
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Aug 30, 2023
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test Linux

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yousofno
Copy link

yousofno commented May 19, 2024

is it fixed in Xcode 15 right now? , because i have this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants