Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3828,8 +3828,8 @@ namespace {
if (!dc)
return nullptr;

// We may have already imported this function decl before we imported the
// parent record. In such a case it's important we don't re-import.
// We may have already imported this function decl while importing its
// decl context. Check decl cache to make sure we don't import twice.
auto known = Impl.ImportedDecls.find({decl, getVersion()});
if (known != Impl.ImportedDecls.end()) {
return known->second;
Expand Down Expand Up @@ -4006,6 +4006,13 @@ namespace {
return nullptr;
}

// We may have already imported this function decl while importing its
// type signature. Check decl cache to make sure we don't import twice.
auto known2 = Impl.ImportedDecls.find({decl, getVersion()});
if (known2 != Impl.ImportedDecls.end()) {
return known2->second;
}

if (name && name.isSimpleName()) {
assert(importedName.hasCustomName() &&
"imported function with simple name?");
Expand Down