From c9bb5468b6ffba250644db86bee0af4bcbb6dc78 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 14 Jun 2016 15:42:32 -0700 Subject: [PATCH] Fix clang warning --- fmt/format.h | 3 ++- test/util-test.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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"); }