diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 9c1c9905fa292..25d057bd9c842 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -749,7 +749,7 @@ class InMemoryDirectory : public InMemoryNode { } InMemoryNode *addChild(StringRef Name, std::unique_ptr Child) { - return Entries.insert(make_pair(Name, std::move(Child))) + return Entries.insert(make_pair(Name.str(), std::move(Child))) .first->second.get(); }