diff --git a/format.cc b/format.cc index fbb0d967..4974b355 100644 --- a/format.cc +++ b/format.cc @@ -66,8 +66,10 @@ using fmt::internal::Arg; #ifndef FMT_THROW # if FMT_EXCEPTIONS # define FMT_THROW(x) throw x +# define FMT_RETURN_AFTER_THROW(x) # else # define FMT_THROW(x) assert(false) +# define FMT_RETURN_AFTER_THROW(x) return x # endif #endif @@ -251,7 +253,7 @@ class WidthHandler : public fmt::internal::ArgVisitor { unsigned visit_unhandled_arg() { FMT_THROW(fmt::FormatError("width is not integer")); - return 0; + FMT_RETURN_AFTER_THROW(0); } template @@ -273,7 +275,7 @@ class PrecisionHandler : public: unsigned visit_unhandled_arg() { FMT_THROW(fmt::FormatError("precision is not integer")); - return 0; + FMT_RETURN_AFTER_THROW(0); } template