diff --git a/include/fmt/os.h b/include/fmt/os.h index 78971e37..680ada4c 100644 --- a/include/fmt/os.h +++ b/include/fmt/os.h @@ -291,7 +291,8 @@ class file { file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; } - file& operator=(file&& other) FMT_NOEXCEPT { + // Move assignment is not noexcept because close may throw. + file& operator=(file&& other) { close(); fd_ = other.fd_; other.fd_ = -1; @@ -399,7 +400,6 @@ class ostream final : private detail::buffer { other.clear(); other.set(nullptr, 0); } - ~ostream() { flush(); delete[] data();