From f971ad75df3a2483aacb45bb0bdd89c4d0f5dd92 Mon Sep 17 00:00:00 2001 From: Matthieu HERNANDEZ Date: Thu, 10 Oct 2024 00:03:48 +0200 Subject: [PATCH] Fix Clang with MSVC When compiling with clang and MSVC as the standard library, clang defines the _MSC_VER and _MSC_FULL_VER macros. Use the __clang_major__ macro to ensure that the code is compiled with MSVC. --- include/cpp2util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cpp2util.h b/include/cpp2util.h index 2015e6444..ebedeb5fb 100644 --- a/include/cpp2util.h +++ b/include/cpp2util.h @@ -368,7 +368,7 @@ constexpr auto gcc_clang_msvc_min_versions( } -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang_major__) // MSVC can't handle 'inline constexpr' variables yet in all cases #define CPP2_CONSTEXPR const #else