diff --git a/fmt/format.h b/fmt/format.h index 474cdf4e..70564e19 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -1514,7 +1514,8 @@ class ArgVisitor { */ Result visit(const Arg &arg) { switch (arg.type) { - default: + case Arg::NONE: + case Arg::NAMED_ARG: FMT_ASSERT(false, "invalid argument type"); return Result(); case Arg::INT: diff --git a/test/util-test.cc b/test/util-test.cc index 838b3b14..1bb7e5d1 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -708,7 +708,7 @@ TEST(ArgVisitorTest, VisitUnhandledArg) { TEST(ArgVisitorTest, VisitInvalidArg) { Arg arg = Arg(); - arg.type = static_cast(Arg::CUSTOM + 1); + arg.type = static_cast(Arg::NONE); EXPECT_ASSERT(TestVisitor().visit(arg), "invalid argument type"); }