From b49af043d7fac27ccc83f86755327877f9a2f18c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 30 Mar 2021 09:51:25 -0700 Subject: [PATCH] Remove noexcept from file's move assignment --- include/fmt/os.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();