diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index e1f45f3da6f31..2463ab049ce7a 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -3310,7 +3310,7 @@ ClangModuleUnit::ClangModuleUnit(ModuleDecl &M, clangModule(clangModule) { // Capture the file metadata before it goes away. if (clangModule) - ASTSourceDescriptor = {*clangModule}; + ASTSourceDescriptor = {*const_cast(clangModule)}; } StringRef ClangModuleUnit::getModuleDefiningPath() const {