mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -1156,14 +1156,11 @@ namespace {
|
||||
return nullptr;
|
||||
// If this is a top-level namespace, don't put it in the module we're
|
||||
// importing, put it in the "__ObjC" module that is implicitly imported.
|
||||
auto clangDC = decl->getDeclContext();
|
||||
while (isa<clang::LinkageSpecDecl>(clangDC))
|
||||
clangDC = clangDC->getParent();
|
||||
if (!clangDC->isNamespace())
|
||||
if (!decl->getParent()->isNamespace())
|
||||
dc = Impl.ImportedHeaderUnit;
|
||||
else {
|
||||
// This is a nested namespace, so just lookup it's parent normally.
|
||||
auto parentNS = cast<clang::NamespaceDecl>(clangDC);
|
||||
auto parentNS = cast<clang::NamespaceDecl>(decl->getParent());
|
||||
auto parent =
|
||||
Impl.importDecl(parentNS, getVersion(), /*UseCanonicalDecl*/ false);
|
||||
// The parent namespace might not be imported if it's `swift_private`.
|
||||
|
||||
Reference in New Issue
Block a user