From 64fea7b69b63cb146820c4b8f8d02fbba787709e Mon Sep 17 00:00:00 2001 From: Jiwoo Park Date: Tue, 16 Apr 2024 01:46:38 +0900 Subject: [PATCH] Fix warning C26495 --- include/fmt/chrono.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 2bbd4761d856..cd1e3a8be1de 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -527,7 +527,7 @@ inline auto localtime(std::time_t time) -> std::tm { std::time_t time_; std::tm tm_; - dispatcher(std::time_t t) : time_(t) {} + dispatcher(std::time_t t) : time_(t), tm_() {} auto run() -> bool { using namespace fmt::detail; @@ -576,7 +576,7 @@ inline auto gmtime(std::time_t time) -> std::tm { std::time_t time_; std::tm tm_; - dispatcher(std::time_t t) : time_(t) {} + dispatcher(std::time_t t) : time_(t), tm_() {} auto run() -> bool { using namespace fmt::detail; @@ -1785,7 +1785,8 @@ class get_locale { bool has_locale_ = false; public: - get_locale(bool localized, locale_ref loc) : has_locale_(localized) { + get_locale(bool localized, locale_ref loc) + : locale_(), has_locale_(localized) { if (localized) ::new (&locale_) std::locale(loc.template get()); }