]> granicus.if.org Git - clang/commitdiff
tighten up operator= to ensure we don't get multiple owners with the same FD.
authorChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2010 18:44:10 +0000 (18:44 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 28 Nov 2010 18:44:10 +0000 (18:44 +0000)
wouldn't move ctors be nice? :)

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

include/clang/Basic/FileManager.h

index 6718112d13359432cde6e2176d8742e0b229ebd0..fbdf75ed9be8a508f1b87f9681c599492c44702c 100644 (file)
@@ -72,7 +72,12 @@ public:
 
   FileEntry(const FileEntry &FE) {
     memcpy(this, &FE, sizeof(FE));
-    assert(FD == -1 && "Cannot copy an file-owning FileEntry");
+    assert(FD == -1 && "Cannot copy a file-owning FileEntry");
+  }
+  
+  void operator=(const FileEntry &FE) {
+    memcpy(this, &FE, sizeof(FE));
+    assert(FD == -1 && "Cannot assign a file-owning FileEntry");
   }
 
   ~FileEntry();