summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Basic/FileManager.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/FileManager.h b/clang/include/clang/Basic/FileManager.h
index d49ec989c0f..1e13442770e 100644
--- a/clang/include/clang/Basic/FileManager.h
+++ b/clang/include/clang/Basic/FileManager.h
@@ -77,7 +77,6 @@ class FileEntry {
File.reset(0); // rely on destructor to close File
}
- FileEntry(const FileEntry &FE) LLVM_DELETED_FUNCTION;
void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
public:
@@ -85,6 +84,15 @@ public:
: UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false)
{}
+ // FIXME: this is here to allow putting FileEntry in std::map. Once we have
+ // emplace, we shouldn't need a copy constructor anymore.
+ /// Intentionally does not copy fields that are not set in an uninitialized
+ /// \c FileEntry.
+ FileEntry(const FileEntry &FE) : UniqueID(FE.UniqueID),
+ IsNamedPipe(FE.IsNamedPipe), InPCH(FE.InPCH), IsValid(FE.IsValid) {
+ assert(!isValid() && "Cannot copy an initialized FileEntry");
+ }
+
const char *getName() const { return Name.c_str(); }
bool isValid() const { return IsValid; }
off_t getSize() const { return Size; }
OpenPOWER on IntegriCloud