From 0fd90dfdf11c648acca2690ab1a55bdf52ca380f Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 26 Sep 2018 13:22:49 +0000 Subject: [PATCH 1/2] Fix compilation with intel compilers (ICC/ICPC) v14.0 --- 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 9f2a1d2f..3d166f56 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2159,7 +2159,8 @@ FMT_CONSTEXPR void parse_format_string( } Handler &handler_; } write{handler}; - auto begin = format_str.data(), end = begin + format_str.size(); + auto begin = format_str.data(); + auto end = begin + format_str.size(); while (begin != end) { // Doing two passes with memchr (one for '{' and another for '}') is up to // 2.5x faster than the naive one-pass implementation on big format strings. diff --git a/test/format-test.cc b/test/format-test.cc index 31a76c3a..538a3534 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1577,7 +1577,7 @@ struct explicitly_convertible_to_string_like { typename String, typename = typename std::enable_if< std::is_constructible::value>::type> - explicit operator String() const { return String("foo", 3u); } + FMT_EXPLICIT operator String() const { return String("foo", 3u); } }; TEST(FormatterTest, FormatExplicitlyConvertibleToStringLike) { From bb845ccc51e9e096727f90d932b9f25483889b99 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 26 Sep 2018 14:31:40 +0000 Subject: [PATCH 2/2] Fix FMT_EXPLICIT detection for GCC --- include/fmt/core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 4820219d..80113740 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -89,7 +89,8 @@ # endif #endif -#if FMT_HAS_FEATURE(cxx_explicit_conversions) || FMT_MSC_VER >= 1800 +#if FMT_HAS_FEATURE(cxx_explicit_conversions) || \ + FMT_GCC_VERSION >= 405 || FMT_MSC_VER >= 1800 # define FMT_EXPLICIT explicit #else # define FMT_EXPLICIT