Skip to content

Commit

Permalink
Fix a -Wweak-vtables warning in clang
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 14, 2016
1 parent dfa631e commit b26e76e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions fmt/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -531,13 +530,12 @@ class BasicCStringRef {
typedef BasicCStringRef<char> CStringRef;
typedef BasicCStringRef<wchar_t> 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 {
Expand Down Expand Up @@ -1316,6 +1314,7 @@ struct NamedArg : Arg {
class RuntimeError : public std::runtime_error {
protected:
RuntimeError() : std::runtime_error("") {}
~RuntimeError() throw();
};

template <typename Impl, typename Char>
Expand Down Expand Up @@ -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_; }
};

Expand Down

0 comments on commit b26e76e

Please sign in to comment.