enable formatting at compile-time for GCC 10.2+

This commit is contained in:
Alexey Ochapov 2020-12-22 22:37:16 +03:00
parent b8d973aaa0
commit 6714f90a5d
No known key found for this signature in database
GPG Key ID: 9DC52E8F031B8DA8
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -184,7 +184,7 @@ TEST(CompileTest, CompileFormatStringLiteral) {
}
#endif
#if __cplusplus >= 202002L
#if __cplusplus >= 202002L || FMT_GCC_VERSION >= 1002
template <size_t max_string_length, typename Char = char> struct test_string {
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {
return fmt::basic_string_view<Char>(rhs).compare(buffer.data()) == 0;