Skip to content

[cxx-interop] Fix printing of namespaces declared in bridging headers #82413

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
Jun 23, 2025

Conversation

egorzhdan
Copy link
Contributor

If a C++ namespace has redeclarations in a bridging header, printing AST for the namespace would crash the compiler. This is because such a redeclaration would not have an owning Clang module, and the AST printer did not account for that.

This change fixes the crash.

rdar://151715540

If a C++ namespace has redeclarations in a bridging header, printing AST for the namespace would crash the compiler. This is because such a redeclaration would not have an owning Clang module, and the AST printer did not account for that.

This change fixes the crash.

rdar://151715540
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jun 23, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan enabled auto-merge June 23, 2025 15:42
@egorzhdan egorzhdan merged commit e232273 into main Jun 23, 2025
3 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/namespace-printer-null-crash branch June 23, 2025 20:07
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.

4 participants