From 6714f90a5dadcae1820c77f22bcc88e7787b4549 Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Tue, 22 Dec 2020 22:37:16 +0300 Subject: [PATCH] enable formatting at compile-time for GCC 10.2+ --- include/fmt/format.h | 2 +- test/compile-test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 8c67805a..a57f7b65 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -282,7 +282,7 @@ FMT_END_NAMESPACE FMT_BEGIN_NAMESPACE namespace detail { -#if __cplusplus >= 202002L +#if __cplusplus >= 202002L || 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 e1bf5173..5dba5019 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -184,7 +184,7 @@ TEST(CompileTest, CompileFormatStringLiteral) { } #endif -#if __cplusplus >= 202002L +#if __cplusplus >= 202002L || 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;