diff --git a/include/fmt/format.h b/include/fmt/format.h index a57f7b65..ec1a7ae1 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -282,7 +282,8 @@ FMT_END_NAMESPACE FMT_BEGIN_NAMESPACE namespace detail { -#if __cplusplus >= 202002L || FMT_GCC_VERSION >= 1002 +#if __cplusplus >= 202002L || \ + (__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002) # define FMT_CONSTEXPR20 constexpr #else # define FMT_CONSTEXPR20 inline diff --git a/test/compile-test.cc b/test/compile-test.cc index 5dba5019..c2e1ec1c 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -184,7 +184,8 @@ TEST(CompileTest, CompileFormatStringLiteral) { } #endif -#if __cplusplus >= 202002L || FMT_GCC_VERSION >= 1002 +#if __cplusplus >= 202002L || \ + (__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002) template struct test_string { template constexpr bool operator==(const T& rhs) const noexcept { return fmt::basic_string_view(rhs).compare(buffer.data()) == 0;