From 0565d65461dd5cd9efdae954176a5d26d57ff2a9 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 24 Feb 2018 09:29:15 +0000 Subject: [PATCH] Fix gcc 7.2 issue --- include/fmt/format.h | 3 ++- test/format-test.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);