Skip to content

[cxx-interop] Avoid importing too complex specializations #59906

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 6, 2022

Conversation

egorzhdan
Copy link
Contributor

This reduces the specialization limit from 10000 to 1000 to prevent Swift from failing to import libstdc++ due to std::_Index_tuple being defined recursively.

This also adds a diagnostic to let the user know why a template instantiation wasn't imported.

rdar://96324175

This reduces the specialization limit from 10000 to 1000 to prevent Swift from failing to import libstdc++ due to `std::_Index_tuple` being defined recursively.

This also adds a diagnostic to let the user know why a template instantiation wasn't imported.

rdar://96324175
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 6, 2022
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan requested a review from zoecarver July 6, 2022 11:30
@egorzhdan egorzhdan merged commit 0032bbb into main Jul 6, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-template-too-deep branch July 6, 2022 14:16
@@ -626,6 +626,10 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
llvm::DenseMap<clang::FunctionDecl *, ValueDecl *>
specializedFunctionTemplates;

/// Stores qualified names of C++ template specializations that were too deep
/// to import into Swift.
llvm::StringSet<> tooDeepTemplateSpecializations;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing the following:

Assertion failed: (isHandleInSync() && "invalid iterator access!"), function operator++, file DenseMap.h, line 1263.

Pretty sure this is the cause.

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