Skip to content

Conversation

@Xazax-hun
Copy link
Contributor

Dropping qualifiers can result in collisions that can trigger compiler crashes or suprious errors. This PR attempts to make sure we always handle the qualifiers when a qualified type is present in the Clang API. The handling of pointers is somewhat special as foreign reference types has custom printing logic.

rdar://164917816

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Nov 25, 2025

using MagicWrapperFrt = MagicWrapper<Foo *>;
using MagicWrapperConstFrt = MagicWrapper<const Foo *>;
using MagicWrapperVolatileFrt = MagicWrapper<volatile Foo *>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also add a definition that refers to the FRT by reference? e.g. MagicWrapper<const Foo &>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Dropping qualifiers can result in collisions that can trigger compiler
crashes or suprious errors. This PR attempts to make sure we always
handle the qualifiers when a qualified type is present in the Clang API.
The handling of pointers is somewhat special as foreign reference types
has custom printing logic.

rdar://164917816
@Xazax-hun Xazax-hun force-pushed the const-frts-collision branch from cd6b00b to cd4e3cc Compare November 25, 2025 16:10
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@egorzhdan
Copy link
Contributor

@swift-ci please test Windows

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