Skip to content

[cxx-interop] Remove impl for constexpr members #60154

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 3 commits into from
Jul 21, 2022

Conversation

Huddie
Copy link
Contributor

@Huddie Huddie commented Jul 20, 2022

Currently we only support constexpr members for int and float types. Unfortunately templated constexpr members are more difficult to handle and are causing some issues when importing c++ stdlib on windows msvc.

For now we will drop support for constexpr members in general until we figure out a better approach for importing them

@Huddie Huddie added the c++ interop Feature: Interoperability with C++ label Jul 20, 2022
@Huddie Huddie requested review from compnerd and zoecarver July 20, 2022 16:22
@Huddie
Copy link
Contributor Author

Huddie commented Jul 20, 2022

@swift-ci please smoke test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks; it is unfortunate that this ended up being complex enough that this seems warranted. Hopefully we can get this implemented soon.

}
if (!value)
// For now we don't import constexpr
if (decl->isConstexpr())
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be static constexpr vars, right? Other vars should work fine (it's just because there's no symbol for static constexpr vars).

@Huddie
Copy link
Contributor Author

Huddie commented Jul 20, 2022

@swift-ci please smoke test

@zoecarver
Copy link
Contributor

LGTM thanks.

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

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

Thanks for all your patients with this, @Huddie.

@Huddie Huddie merged commit 0f83b65 into swiftlang:main Jul 21, 2022
Catfish-Man pushed a commit to Catfish-Man/swift that referenced this pull request Jul 28, 2022
* Remove impl for constexpr members

* Readd some tets

* Only remove import of static constexpr
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