Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -2981,7 +2981,7 @@ // linkage later if it's redeclared outside the class. return false; if (CXX20ModuleInits && VD->getOwningModule() && - !VD->getOwningModule()->isModuleMapModule()) { + !VD->getOwningModule()->isHeaderLikeModule()) { // For CXX20, module-owned initializers need to be deferred, since it is // not known at this point if they will be run for the current module or // as part of the initializer for an imported one. @@ -6291,7 +6291,7 @@ // initializer for imported modules, and that will likewise call those for // any imports it has. if (CXX20ModuleInits && Import->getImportedOwningModule() && - !Import->getImportedOwningModule()->isModuleMapModule()) + !Import->getImportedOwningModule()->isHeaderLikeModule()) break; // For clang C++ module map modules the initializers for sub-modules are Index: clang/lib/Sema/SemaDecl.cpp =================================================================== --- clang/lib/Sema/SemaDecl.cpp +++ clang/lib/Sema/SemaDecl.cpp @@ -9502,7 +9502,7 @@ bool ImplicitInlineCXX20 = !getLangOpts().CPlusPlusModules || !NewFD->getOwningModule() || NewFD->getOwningModule()->isGlobalModule() || - NewFD->getOwningModule()->isModuleMapModule(); + NewFD->getOwningModule()->isHeaderLikeModule(); bool isInline = D.getDeclSpec().isInlineSpecified(); bool isVirtual = D.getDeclSpec().isVirtualSpecified(); bool hasExplicit = D.getDeclSpec().hasExplicitSpecifier(); Index: clang/lib/Sema/SemaLookup.cpp =================================================================== --- clang/lib/Sema/SemaLookup.cpp +++ clang/lib/Sema/SemaLookup.cpp @@ -1913,8 +1913,8 @@ Module *DeclModule = SemaRef.getOwningModule(D); assert(DeclModule && "hidden decl has no owning module"); - // Entities in module map modules are reachable only if they're visible. - if (DeclModule->isModuleMapModule()) + // Entities in header like modules are reachable only if they're visible. + if (DeclModule->isHeaderLikeModule()) return false; // If D comes from a module and SemaRef doesn't own a module, it implies D Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -6402,7 +6402,7 @@ // Functions with internal linkage are only viable in the same module unit. if (auto *MF = Function->getOwningModule()) { - if (getLangOpts().CPlusPlusModules && !MF->isModuleMapModule() && + if (getLangOpts().CPlusPlusModules && !MF->isHeaderLikeModule() && !isModuleUnitOfCurrentTU(MF)) { /// FIXME: Currently, the semantics of linkage in clang is slightly /// different from the semantics in C++ spec. In C++ spec, only names