diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -2048,7 +2048,7 @@ Map.LangOpts.CurrentModule == ModuleName && SourceMgr.getDecomposedLoc(ModuleNameLoc).first != SourceMgr.getDecomposedLoc(Existing->DefinitionLoc).first; - if (!ActiveModule && (LoadedFromASTFile || Inferred || ParsedAsMainInput)) { + if (LoadedFromASTFile || Inferred || ParsedAsMainInput) { // Skip the module definition. skipUntil(MMToken::RBrace); if (Tok.is(MMToken::RBrace)) diff --git a/clang/test/ClangScanDeps/modules-private-framework-submodule.c b/clang/test/ClangScanDeps/modules-private-framework-submodule.c --- a/clang/test/ClangScanDeps/modules-private-framework-submodule.c +++ b/clang/test/ClangScanDeps/modules-private-framework-submodule.c @@ -9,7 +9,7 @@ //--- frameworks2/FW2.framework/Modules/module.modulemap framework module FW2 { header "FW2.h" } //--- frameworks2/FW2.framework/Modules/module.private.modulemap -framework module FW2_Private { header "FW2_Private.h" } +explicit module FW2.Private { header "FW2_Private.h" } //--- frameworks2/FW2.framework/Headers/FW2.h //--- frameworks2/FW2.framework/PrivateHeaders/FW2_Private.h @@ -40,7 +40,7 @@ // CHECK-NEXT: }, // CHECK-NEXT: { // CHECK-NEXT: "context-hash": "{{.*}}", -// CHECK-NEXT: "module-name": "FW2_Private" +// CHECK-NEXT: "module-name": "FW2" // CHECK-NEXT: } // CHECK-NEXT: ], // CHECK: "file-deps": [