diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index bace9f61..71e43765 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -242,6 +242,12 @@ namespace cling { bool usingCxxModules = getSema().getLangOpts().Modules; + if (usingCxxModules) { + // Explicitly create the modulemanager now. If we would create it later + // implicitly then it would just overwrite our callbacks we set below. + m_IncrParser->getCI()->createModuleManager(); + } + // When using C++ modules, we setup the callbacks now that we have them // ready before we parse code for the first time. Without C++ modules // we can't setup the calls now because the clang PCH currently just