Skip to content

[cxx-interop] Do not instantiate templates in unevaluated contexts #61552

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
Oct 13, 2022

Conversation

egorzhdan
Copy link
Contributor

Previously we tried to instantiate templates in unevaluated contexts. Some of these templates might not be instantiatable, which caused compile errors, while the equivalent C++ code compiles and runs with no issue.

This was problematic for std::vector with libstdc++ on Linux.

Fixes #61547.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Oct 12, 2022
@egorzhdan egorzhdan requested review from hyp and zoecarver October 12, 2022 14:26
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@hyp hyp left a comment

Choose a reason for hiding this comment

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

Awesome!

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-declval branch from 7555ea5 to a29a236 Compare October 12, 2022 16:37
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Previously we tried to instantiate templates in unevaluated contexts. Some of these templates might not be instantiatable, which caused compile errors, while the equivalent C++ code compiles and runs with no issue.

This was problematic for `std::vector` with libstdc++ on Linux.

Fixes #61547.
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-declval branch from a29a236 to 1b41703 Compare October 12, 2022 18:05
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@egorzhdan egorzhdan merged commit df9236c into main Oct 13, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-declval branch October 13, 2022 10:30
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.

[interop] std::declval body is being imported by Clang importer
3 participants