Skip to content

Commit b3feb9e

Browse files
committed
[cxx-interop] Fix namespace lookup
If a namespace has redecls in different modules, Swift sometimes picked a redecl which is not visible from the requested module, and wrongly removed the namespace from lookup results. This resulted in errors like this: ``` *** DESERIALIZATION FAILURE *** Could not deserialize type for 'init(cxxString:)' Caused by: top-level value not found (std) Cross-reference to module '__ObjC' ... std ```
1 parent 4820838 commit b3feb9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2725,7 +2725,7 @@ static bool isVisibleFromModule(const ClangModuleUnit *ModuleFilter,
27252725
// Handle redeclarable Clang decls by checking each redeclaration.
27262726
bool IsTagDecl = isa<clang::TagDecl>(D);
27272727
if (!(IsTagDecl || isa<clang::FunctionDecl>(D) || isa<clang::VarDecl>(D) ||
2728-
isa<clang::TypedefNameDecl>(D))) {
2728+
isa<clang::TypedefNameDecl>(D) || isa<clang::NamespaceDecl>(D))) {
27292729
return false;
27302730
}
27312731

0 commit comments

Comments
 (0)