diff --git a/include/fmt/format.h b/include/fmt/format.h index 4d40598c..85e84044 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1992,7 +1992,8 @@ FMT_CONSTEXPR void parse_format_string(Iterator it, Handler &&handler) { template FMT_CONSTEXPR const typename ParseContext::char_type * parse_format_specs(ParseContext &ctx) { - formatter f; + // GCC 7.2 requires initializer. + formatter f{}; return f.parse(ctx); } diff --git a/test/format-test.cc b/test/format-test.cc index 01c8dbbd..4555e479 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1929,7 +1929,7 @@ FMT_CONSTEXPR bool test_error(const char *fmt, const char *expected_error) { TEST(FormatTest, FormatStringErrors) { EXPECT_ERROR("foo", nullptr); EXPECT_ERROR("}", "unmatched '}' in format string"); - //EXPECT_ERROR("{0:s", "unknown format specifier", Date); + EXPECT_ERROR("{0:s", "unknown format specifier", Date); #ifndef _MSC_VER // This causes an internal compiler error in MSVC2017. EXPECT_ERROR("{0:=5", "unknown format specifier", int);