Skip to content

Add _const to Swift declaration names of const types #75297

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
Jul 18, 2024

Conversation

susmonteiro
Copy link
Contributor

@susmonteiro susmonteiro commented Jul 17, 2024

This change is necessary to differentiate between C++ const and non-const types in Swift.
For instance, const int and int would both be printed as CInt in Swift.
After this change, const int is stored as CInt_const

@susmonteiro susmonteiro force-pushed the susmonteiro/cxx-const-types branch from 5217ed4 to 2cda67a Compare July 17, 2024 15:44
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro added the c++ interop Feature: Interoperability with C++ label Jul 17, 2024
@susmonteiro susmonteiro force-pushed the susmonteiro/cxx-const-types branch from 2cda67a to 662ed25 Compare July 17, 2024 17:15
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro marked this pull request as ready for review July 17, 2024 17:26
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!

@egorzhdan
Copy link
Contributor

@swift-ci please smoke test Linux

This change is necessary to differentiate between C++ const and non-const types in Swift.
For instance, `const int` and `int` would both be printed as `CInt` in Swift.
After this change, `const int` is stored as `CInt_const`
@susmonteiro susmonteiro force-pushed the susmonteiro/cxx-const-types branch from 662ed25 to 24fc755 Compare July 18, 2024 13:14
@susmonteiro
Copy link
Contributor Author

@swift-ci please smoke test

@susmonteiro susmonteiro merged commit 8b45e33 into main Jul 18, 2024
3 checks passed
@susmonteiro susmonteiro deleted the susmonteiro/cxx-const-types branch July 18, 2024 16:14
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