diff --git a/include/fmt/core.h b/include/fmt/core.h index 95f2eef2..cfbe019a 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2739,6 +2739,10 @@ FMT_CONSTEXPR auto parse_float_type_spec(const basic_format_specs& specs, auto result = float_specs(); result.showpoint = specs.alt; result.locale = specs.localized; +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4061) +#endif switch (specs.type) { case presentation_type::none: result.format = float_format::general; @@ -2769,19 +2773,13 @@ FMT_CONSTEXPR auto parse_float_type_spec(const basic_format_specs& specs, case presentation_type::hexfloat_lower: result.format = float_format::hex; break; - case presentation_type::dec: - case presentation_type::oct: - case presentation_type::hex_lower: - case presentation_type::hex_upper: - case presentation_type::bin_lower: - case presentation_type::bin_upper: - case presentation_type::chr: - case presentation_type::string: - case presentation_type::pointer: default: eh.on_error("invalid type specifier"); break; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif return result; } diff --git a/include/fmt/format.h b/include/fmt/format.h index f57427ab..58bfbaea 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1572,6 +1572,10 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, static_assert(std::is_same>::value, ""); auto abs_value = arg.abs_value; auto prefix = arg.prefix; +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4061) +#endif switch (specs.type) { case presentation_type::none: case presentation_type::dec: { @@ -1621,19 +1625,12 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, } case presentation_type::chr: return write_char(out, static_cast(abs_value), specs); - case presentation_type::hexfloat_lower: - case presentation_type::hexfloat_upper: - case presentation_type::exp_lower: - case presentation_type::exp_upper: - case presentation_type::fixed_lower: - case presentation_type::fixed_upper: - case presentation_type::general_lower: - case presentation_type::general_upper: - case presentation_type::string: - case presentation_type::pointer: default: throw_format_error("invalid type specifier"); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif return out; } template