================ @@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) { // Use the cached result, which may be nullptr. Module = *MaybeModule; + // Config macros are already checked before building a module, but they need + // to be checked at each import location in case any of the config macros + // have a new value at the current `ImportLoc`. + if (Module) + checkConfigMacros(getPreprocessor(), Module, ImportLoc); } else if (ModuleName == getLangOpts().CurrentModule) { // This is the module we're building. Module = PP->getHeaderSearchInfo().lookupModule( ---------------- Bigcheese wrote:
Hmm, I assumed it wasn't needed because this is just `-fmodule-name=` which causes textual inclusion, but it looks like the original code would warn in that case, even though they actually would apply if it was the first inclusion. I'll check and see if it matters. https://github.com/llvm/llvm-project/pull/83641 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits