Add ArgVisitor::report_unhandled_arg
and get rid of FMT_RETURN_AFTER_THROW.
diff --git a/format.cc b/format.cc
index 6f02a81..fe4f1b1 100644
--- a/format.cc
+++ b/format.cc
@@ -66,10 +66,8 @@
#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
@@ -291,9 +289,8 @@
public:
explicit WidthHandler(fmt::FormatSpec &spec) : spec_(spec) {}
- unsigned visit_unhandled_arg() {
+ void report_unhandled_arg() {
FMT_THROW(fmt::FormatError("width is not integer"));
- FMT_RETURN_AFTER_THROW(0);
}
template <typename T>
@@ -313,9 +310,8 @@
class PrecisionHandler :
public fmt::internal::ArgVisitor<PrecisionHandler, int> {
public:
- unsigned visit_unhandled_arg() {
+ void report_unhandled_arg() {
FMT_THROW(fmt::FormatError("precision is not integer"));
- FMT_RETURN_AFTER_THROW(0);
}
template <typename T>