Cleanup conseval detection

This commit is contained in:
Victor Zverovich
2024-01-12 04:42:28 -08:00
parent b71d98774b
commit 52174953bc
3 changed files with 61 additions and 74 deletions

View File

@ -8,10 +8,7 @@
#include "fmt/compile.h"
#include "gmock/gmock.h"
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806 && \
defined(__cpp_constexpr) && __cpp_constexpr >= 201907 && \
defined(__cpp_constexpr_dynamic_alloc) && \
__cpp_constexpr_dynamic_alloc >= 201907 && FMT_CPLUSPLUS >= 202002L
#if FMT_USE_CONSTEVAL
template <size_t max_string_length, typename Char = char> struct test_string {
template <typename T> constexpr bool operator==(const T& rhs) const noexcept {
@ -60,4 +57,5 @@ TEST(compile_time_formatting_test, floating_point) {
EXPECT_EQ("+inf", test_format<5>(FMT_COMPILE("{:+}"), inf));
EXPECT_EQ("-inf", test_format<5>(FMT_COMPILE("{}"), -inf));
}
#endif
#endif // FMT_USE_CONSTEVAL