Fix warnings

This commit is contained in:
Victor Zverovich 2019-06-17 09:21:29 -07:00
parent fd2292f13a
commit 1c3197b8d8
3 changed files with 11 additions and 6 deletions

View File

@ -766,7 +766,7 @@ template <typename Context> struct arg_mapper {
return val; return val;
} }
FMT_CONSTEXPR double map(float val) { return val; } FMT_CONSTEXPR double map(float val) { return static_cast<double>(val); }
FMT_CONSTEXPR double map(double val) { return val; } FMT_CONSTEXPR double map(double val) { return val; }
FMT_CONSTEXPR long double map(long double val) { return val; } FMT_CONSTEXPR long double map(long double val) { return val; }

View File

@ -218,6 +218,9 @@ FMT_FUNC Char internal::thousands_sep_impl(locale_ref) {
} }
#endif #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, FMT_FUNC void system_error::init(int err_code, string_view format_str,
format_args args) { format_args args) {
error_code_ = err_code; error_code_ = err_code;

View File

@ -73,10 +73,6 @@
# pragma GCC diagnostic ignored "-Wshadow" # pragma GCC diagnostic ignored "-Wshadow"
#endif #endif
#if FMT_CLANG_VERSION
# pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template"
#endif
#ifdef _SECURE_SCL #ifdef _SECURE_SCL
# define FMT_SECURE_SCL _SECURE_SCL # define FMT_SECURE_SCL _SECURE_SCL
#else #else
@ -299,9 +295,9 @@ using wwriter = basic_writer<back_insert_range<internal::buffer<wchar_t>>>;
class format_error : public std::runtime_error { class format_error : public std::runtime_error {
public: public:
explicit format_error(const char* message) : std::runtime_error(message) {} explicit format_error(const char* message) : std::runtime_error(message) {}
explicit format_error(const std::string& message) explicit format_error(const std::string& message)
: std::runtime_error(message) {} : std::runtime_error(message) {}
~format_error() FMT_NOEXCEPT;
}; };
namespace internal { namespace internal {
@ -2274,6 +2270,7 @@ class system_error : public std::runtime_error {
: std::runtime_error("") { : std::runtime_error("") {
init(error_code, message, make_format_args(args...)); init(error_code, message, make_format_args(args...));
} }
~system_error() FMT_NOEXCEPT;
int error_code() const { return error_code_; } int error_code() const { return error_code_; }
}; };
@ -3555,10 +3552,15 @@ template <typename Char> struct udl_arg {
inline namespace literals { inline namespace literals {
# if FMT_USE_UDL_TEMPLATE # if FMT_USE_UDL_TEMPLATE
# pragma GCC diagnostic push
# if FMT_CLANG_VERSION
# pragma GCC diagnostic ignored "-Wgnu-string-literal-operator-template"
# endif
template <typename Char, Char... CHARS> template <typename Char, Char... CHARS>
FMT_CONSTEXPR internal::udl_formatter<Char, CHARS...> operator""_format() { FMT_CONSTEXPR internal::udl_formatter<Char, CHARS...> operator""_format() {
return {}; return {};
} }
# pragma GCC diagnostic pop
# else # else
/** /**
\rst \rst