From 8f1d0ba39ff0c25952d097f19365384b5d52b802 Mon Sep 17 00:00:00 2001 From: neargye Date: Tue, 10 Nov 2020 19:14:54 +0200 Subject: [PATCH] fix clang with msvc --- include/magic_enum.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 68679ea..5da2314 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -211,7 +211,7 @@ constexpr string_view pretty_name(string_view name) noexcept { } constexpr std::size_t find(string_view str, char c) noexcept { -#if defined(__clang__) && __clang_major__ < 9 && defined(__GLIBCXX__) || defined(_MSC_VER) && _MSC_VER < 1920 +#if defined(__clang__) && __clang_major__ < 9 && defined(__GLIBCXX__) || defined(_MSC_VER) && _MSC_VER < 1920 && !defined(__clang__) // https://stackoverflow.com/questions/56484834/constexpr-stdstring-viewfind-last-of-doesnt-work-on-clang-8-with-libstdc // https://developercommunity.visualstudio.com/content/problem/360432/vs20178-regression-c-failed-in-test.html constexpr auto workaroung = true; @@ -233,7 +233,7 @@ constexpr std::size_t find(string_view str, char c) noexcept { template constexpr bool cmp_equal(string_view lhs, string_view rhs, BinaryPredicate&& p) noexcept(std::is_nothrow_invocable_r_v) { -#if defined(_MSC_VER) && _MSC_VER < 1920 +#if defined(_MSC_VER) && _MSC_VER < 1920 && !defined(__clang__) // https://developercommunity.visualstudio.com/content/problem/360432/vs20178-regression-c-failed-in-test.html // https://developercommunity.visualstudio.com/content/problem/232218/c-constexpr-string-view.html constexpr auto workaroung = true;