diff --git a/include/swift/Basic/SourceManager.h b/include/swift/Basic/SourceManager.h index 1072b8bd3b1..e5149f1146f 100644 --- a/include/swift/Basic/SourceManager.h +++ b/include/swift/Basic/SourceManager.h @@ -40,7 +40,7 @@ class SourceManager { int LineOffset; }; std::map VirtualFiles; - mutable std::pair CachedVFile = {}; + mutable std::pair CachedVFile = {nullptr, nullptr}; public: llvm::SourceMgr &getLLVMSourceMgr() { diff --git a/lib/Basic/SourceLoc.cpp b/lib/Basic/SourceLoc.cpp index 9bc484c5eb7..b6e08734119 100644 --- a/lib/Basic/SourceLoc.cpp +++ b/lib/Basic/SourceLoc.cpp @@ -82,7 +82,7 @@ bool SourceManager::openVirtualFile(SourceLoc loc, StringRef name, CharSourceRange range = CharSourceRange(*this, loc, end); VirtualFiles[end.Value.getPointer()] = { range, name, lineOffset }; - CachedVFile = {}; + CachedVFile = {nullptr, nullptr}; return true; } @@ -99,7 +99,7 @@ void SourceManager::closeVirtualFile(SourceLoc end) { #endif return; } - CachedVFile = {}; + CachedVFile = {nullptr, nullptr}; CharSourceRange oldRange = virtualFile->Range; virtualFile->Range = CharSourceRange(*this, virtualFile->Range.getStart(),