From: Chris Lattner Date: Sun, 28 Nov 2010 18:44:10 +0000 (+0000) Subject: tighten up operator= to ensure we don't get multiple owners with the same FD. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4fed47acee9e7ca9c9cfa77c3920eec4639d7d0;p=clang tighten up operator= to ensure we don't get multiple owners with the same FD. wouldn't move ctors be nice? :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120255 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 6718112d13..fbdf75ed9b 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -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();