Skip to content

🍒[cxx-interop][SwiftToCxx] Do not crash while trying to expose a macro to C++ #73567

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
May 13, 2024

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented May 10, 2024

Explanation: This fixes a compiler crash that happened when emitting a Clang header for a Swift module that declares multiple macros with the same base name and different argument names. Swift macros are not currently designed to be exposed to C++, so this change makes sure we don't try to emit them.
Scope: Changes the logic that generates C++ representation of Swift decls.
Risk: Low, only affects generation of a C++ header.
Testing: Added a compile test.
Issue: rdar://117969472 / #69656
Reviewer: @fahadnayyar

Original PR: #73510

… to C++

This fixes a compiler crash that happened when emitting a Clang header for a Swift module that declares multiple macros with the same base name and different argument names.

Swift macros are not currently designed to be exposed to C++. This teaches the compiler to explicitly mark them as unavailable in C++.

rdar://117969472 / resolves #69656
(cherry picked from commit f42609b)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label May 10, 2024
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan marked this pull request as ready for review May 13, 2024 12:36
@egorzhdan egorzhdan requested a review from a team as a code owner May 13, 2024 12:36
@egorzhdan egorzhdan merged commit d5280a2 into release/6.0 May 13, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/6.0-macro-name-collision branch May 13, 2024 15:27
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