Initialize all the things

This commit is contained in:
Victor Zverovich 2019-10-20 17:12:19 -07:00
parent e2ea940673
commit 8498bc97dd
2 changed files with 8 additions and 10 deletions

View File

@ -2528,10 +2528,9 @@ FMT_CONSTEXPR const typename ParseContext::char_type* parse_format_specs(
conditional_t<internal::mapped_type_constant<T, context>::value !=
internal::custom_type,
decltype(arg_mapper<context>().map(std::declval<T>())), T>;
conditional_t<has_formatter<mapped_type, context>::value,
formatter<mapped_type, char_type>,
internal::fallback_formatter<T, char_type>>
f;
auto f = conditional_t<has_formatter<mapped_type, context>::value,
formatter<mapped_type, char_type>,
internal::fallback_formatter<T, char_type>>();
return f.parse(ctx);
}
@ -2816,9 +2815,8 @@ void internal::basic_writer<Range>::write_fp(T value,
bool use_grisu = USE_GRISU &&
(specs.type != 'a' && specs.type != 'A' &&
specs.type != 'e' && specs.type != 'E') &&
internal::grisu_format(
static_cast<double>(value), buffer, precision,
options, exp);
internal::grisu_format(static_cast<double>(value), buffer,
precision, options, exp);
char* decimal_point_pos = nullptr;
if (!use_grisu)
decimal_point_pos = internal::sprintf_format(value, buffer, specs);

View File

@ -2293,9 +2293,9 @@ struct test_context {
template <size_t N>
FMT_CONSTEXPR fmt::format_specs parse_specs(const char (&s)[N]) {
fmt::format_specs specs;
test_parse_context parse_ctx;
test_context ctx{};
auto specs = fmt::format_specs();
auto parse_ctx = test_parse_context();
auto ctx = test_context();
fmt::internal::specs_handler<test_parse_context, test_context> h(
specs, parse_ctx, ctx);
parse_format_specs(s, s + N, h);