diff --git a/include/fmt/core.h b/include/fmt/core.h index 3ddb3b4a..f519b5d9 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -156,7 +156,8 @@ void operator=(const Type &) FMT_DELETED #if (FMT_HAS_INCLUDE() && __cplusplus > 201402L) || \ - (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) + (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) || \ + _LIBCPP_VERSION // libc++ supports string_view in pre-c++17 # include # define FMT_USE_STD_STRING_VIEW // std::experimental::basic_string_view::remove_prefix isn't constexpr until diff --git a/test/format-test.cc b/test/format-test.cc index 0ea41c83..8c35dc43 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1201,7 +1201,7 @@ TEST(FormatterTest, FormatStringView) { } #ifdef FMT_USE_STD_STRING_VIEW -TEST(FormatterTest, FormatStringView) { +TEST(FormatterTest, FormatStdStringView) { EXPECT_EQ("test", format("{0}", std::string_view("test"))); } #endif