From 1c3197b8d84884b0e16ba76b2c211ac35d2fa679 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 17 Jun 2019 09:21:29 -0700 Subject: [PATCH] Fix warnings --- include/fmt/core.h | 2 +- include/fmt/format-inl.h | 3 +++ include/fmt/format.h | 12 +++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 5e0286bf..42e47b98 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -766,7 +766,7 @@ template struct arg_mapper { return val; } - FMT_CONSTEXPR double map(float val) { return val; } + FMT_CONSTEXPR double map(float val) { return static_cast(val); } FMT_CONSTEXPR double map(double val) { return val; } FMT_CONSTEXPR long double map(long double val) { return val; } diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 250cd70b..2a2a0fab 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -218,6 +218,9 @@ FMT_FUNC Char internal::thousands_sep_impl(locale_ref) { } #endif +FMT_FUNC format_error::~format_error() FMT_NOEXCEPT {} +FMT_FUNC system_error::~system_error() FMT_NOEXCEPT {} + FMT_FUNC void system_error::init(int err_code, string_view format_str, format_args args) { error_code_ = err_code; diff --git a/include/fmt/format.h b/include/fmt/format.h index 3f761f24..ed755459 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -73,10 +73,6 @@ # pragma GCC diagnostic ignored "-Wshadow" #endif -#if FMT_CLANG_VERSION -# pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template" -#endif - #ifdef _SECURE_SCL # define FMT_SECURE_SCL _SECURE_SCL #else @@ -299,9 +295,9 @@ using wwriter = basic_writer>>; class format_error : public std::runtime_error { public: explicit format_error(const char* message) : std::runtime_error(message) {} - explicit format_error(const std::string& message) : std::runtime_error(message) {} + ~format_error() FMT_NOEXCEPT; }; namespace internal { @@ -2274,6 +2270,7 @@ class system_error : public std::runtime_error { : std::runtime_error("") { init(error_code, message, make_format_args(args...)); } + ~system_error() FMT_NOEXCEPT; int error_code() const { return error_code_; } }; @@ -3555,10 +3552,15 @@ template struct udl_arg { inline namespace literals { # if FMT_USE_UDL_TEMPLATE +# pragma GCC diagnostic push +# if FMT_CLANG_VERSION +# pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template" +# endif template FMT_CONSTEXPR internal::udl_formatter operator""_format() { return {}; } +# pragma GCC diagnostic pop # else /** \rst