fix macro check for formatting at compile-time on GCC 10.2+

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

View File

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

View File

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