From b26e76efe9417ea773bb1e6c6ce875646c71a346 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 14 Jun 2016 08:11:33 -0700 Subject: [PATCH] Fix a -Wweak-vtables warning in clang --- fmt/format.cc | 5 +++++ fmt/format.h | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fmt/format.cc b/fmt/format.cc index 64499ad788c8..212810b4e8f1 100644 --- a/fmt/format.cc +++ b/fmt/format.cc @@ -80,6 +80,11 @@ static inline fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { } namespace fmt { + +FMT_FUNC internal::RuntimeError::~RuntimeError() throw() {} +FMT_FUNC FormatError::~FormatError() throw() {} +FMT_FUNC SystemError::~SystemError() throw() {} + namespace { #ifndef _MSC_VER diff --git a/fmt/format.h b/fmt/format.h index 0c9b2ce8dedb..474cdf4e3306 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -228,7 +228,6 @@ typedef __int64 intmax_t; # define FMT_ASSERT(condition, message) assert((condition) && message) #endif - #if FMT_GCC_VERSION >= 400 || FMT_HAS_BUILTIN(__builtin_clz) # define FMT_BUILTIN_CLZ(n) __builtin_clz(n) #endif @@ -531,13 +530,12 @@ class BasicCStringRef { typedef BasicCStringRef CStringRef; typedef BasicCStringRef WCStringRef; -/** - A formatting error such as invalid format string. -*/ +/** A formatting error such as invalid format string. */ class FormatError : public std::runtime_error { public: explicit FormatError(CStringRef message) : std::runtime_error(message.c_str()) {} + ~FormatError() throw(); }; namespace internal { @@ -1316,6 +1314,7 @@ struct NamedArg : Arg { class RuntimeError : public std::runtime_error { protected: RuntimeError() : std::runtime_error("") {} + ~RuntimeError() throw(); }; template @@ -2259,6 +2258,8 @@ class SystemError : public internal::RuntimeError { } FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef) + ~SystemError() throw(); + int error_code() const { return error_code_; } };