Skip to content

[cxx-interop] Properly import annotations from functions in namespace scope #80986

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Apr 22, 2025

C++ namespaces are imported as Swift enums. This confused the logic that skips importing namespaces for free functions that are imported as member functions via the SWIFT_NAME attribute.

rdar://149756644

… scope

C++ namespaces are imported as Swift enums. This confused the logic that
skips importing namespaces for free functions that are imported as
member functions via the SWIFT_NAME attribute.

rdar://149756644
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun changed the title [cxx-interop] Properly import annotations from functions in namespace… [cxx-interop] Properly import annotations from functions in namespace scope Apr 22, 2025
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test Windows

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test Linux

@Xazax-hun Xazax-hun enabled auto-merge April 23, 2025 14:01
@Xazax-hun Xazax-hun merged commit 8c84ee2 into main Apr 23, 2025
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/namespace-scope-lifetime-annotations branch April 23, 2025 15:02
Xazax-hun added a commit that referenced this pull request Apr 23, 2025
…space scope

Explanation: C++ namespaces imported as Swift enums. This was not
accounted for in a condition and that resulted in not importing lifetime
annotations for functions that are in namespace scope. This PR fixes
that condition.
Issue: rdar://149756644
Risk: Low, the fix is very targeted.
Testing: Regression test added.
Original PR: #80986
Reviewer: @j-hui
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.

2 participants