From f232fbcc8230330e687faafe9c08377e5e8b01aa Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 15 Nov 2024 08:26:34 -0800 Subject: [PATCH] Remove more MSVC 2015 workarounds and fix string_view checks --- test/base-test.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/base-test.cc b/test/base-test.cc index 1ee0c657c78f..11ea1df777c8 100644 --- a/test/base-test.cc +++ b/test/base-test.cc @@ -645,9 +645,7 @@ TEST(base_test, is_formattable) { EXPECT_TRUE(fmt::is_formattable::value); EXPECT_TRUE(fmt::is_formattable::value); -#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910 EXPECT_FALSE(fmt::is_formattable::value); -#endif EXPECT_FALSE(fmt::is_formattable::value); const auto f = convertible_to_pointer_formattable(); @@ -745,7 +743,7 @@ TEST(base_test, no_implicit_conversion_to_string_view) { fmt::is_formattable::value); } -#ifdef FMT_USE_STRING_VIEW +#ifdef FMT_CPLUSPLUS >= 201703L struct implicitly_convertible_to_std_string_view { operator std::string_view() const { return "foo"; } }; @@ -754,10 +752,8 @@ TEST(base_test, no_implicit_conversion_to_std_string_view) { EXPECT_FALSE( fmt::is_formattable::value); } -#endif +#endif // FMT_CPLUSPLUS >= 201703L -// std::is_constructible is broken in MSVC until version 2015. -#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1900 struct explicitly_convertible_to_string_view { explicit operator fmt::string_view() const { return "foo"; } }; @@ -769,7 +765,7 @@ TEST(base_test, format_explicitly_convertible_to_string_view) { !fmt::is_formattable::value, ""); } -# ifdef FMT_USE_STRING_VIEW +#ifdef FMT_CPLUSPLUS >= 201703L struct explicitly_convertible_to_std_string_view { explicit operator std::string_view() const { return "foo"; } }; @@ -781,8 +777,7 @@ TEST(base_test, format_explicitly_convertible_to_std_string_view) { !fmt::is_formattable::value, ""); } -# endif -#endif +#endif // FMT_CPLUSPLUS >= 201703L TEST(base_test, has_formatter) { EXPECT_TRUE((fmt::detail::has_formatter()));