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

View File

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