Fix VS C4061 warning when using /Wall

This commit is contained in:
David Connet 2022-01-03 08:41:37 -08:00
parent 8e59744b8d
commit 66e4723eaf
2 changed files with 19 additions and 0 deletions

View File

@ -2769,6 +2769,15 @@ FMT_CONSTEXPR auto parse_float_type_spec(const basic_format_specs<Char>& 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;

View File

@ -1621,6 +1621,16 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg<T> arg,
}
case presentation_type::chr:
return write_char(out, static_cast<Char>(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");
}