================
@@ -772,7 +772,12 @@ void Sema::BuildModuleInclude(SourceLocation DirectiveLoc,
Module *Mod) {
Module *ThisModule = PP.getHeaderSearchInfo().lookupModule(
getLangOpts().CurrentModule, DirectiveLoc, false, false);
(void)ThisModule;
- assert(ThisModule && "was expecting a module if building one");
+ // For named modules, the current module name is not known while parsing
the
+ // global module fragment and lookupModule may return null.
+ assert((getLangOpts().getCompilingModule() ==
+ LangOptionsBase::CMK_ModuleInterface ||
+ ThisModule) &&
+ "was expecting a module if building a Clang module");
----------------
kobykahane wrote:
```suggestion
"was expecting a module if building a Clang module");
```
https://github.com/llvm/llvm-project/pull/159771
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits