diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-28 18:44:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-28 18:44:10 +0000 |
commit | e4fed47acee9e7ca9c9cfa77c3920eec4639d7d0 (patch) | |
tree | 4b055fec9e2e773dc67d6fdf9dd8a4b0c85be49c /include/clang/Basic/FileManager.h | |
parent | 71b48d64cdab8e86229576ae4c8860f98ca87ac4 (diff) |
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
Diffstat (limited to 'include/clang/Basic/FileManager.h')
-rw-r--r-- | include/clang/Basic/FileManager.h | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |