]> granicus.if.org Git - clang/commitdiff
Revert "FileEntry: Remove unused and half-broken copy ctor."
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 4 Mar 2014 21:49:45 +0000 (21:49 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 4 Mar 2014 21:49:45 +0000 (21:49 +0000)
Looks like libstdc++ 4.7 still needs it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202896 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/FileManager.h

index d49ec989c0f370bc84ba17c295b8f9dff80f44c2..1e13442770ee9db4fcc2376db9d851a8efae30e4 100644 (file)
@@ -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; }