Commit 1a6d365d authored by Victor Zverovich's avatar Victor Zverovich

Fix move assignment.

parent 823ce5fc
......@@ -204,7 +204,7 @@ TEST(FileTest, MoveAssignmentClosesFile) {
File f2("CMakeLists.txt", File::RDONLY);
int old_fd = f2.descriptor();
f2 = std::move(f);
EXPECT_TRUE(IsClosedInternal(old_fd));
EXPECT_CLOSED(old_fd);
}
File OpenFile(int &fd) {
......
......@@ -177,7 +177,8 @@ class File {
other.fd_ = -1;
}
File& operator=(File &&other) FMT_NOEXCEPT(true) {
File& operator=(File &&other) {
close();
fd_ = other.fd_;
other.fd_ = -1;
return *this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment