diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index 102af4d88f..3d3eff382f 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -241,6 +241,7 @@ consoletaeftemplates consoleuwp CONSOLEWINDOWOWNER consrv +consteval constexprable contentfiles conterm diff --git a/src/inc/LibraryIncludes.h b/src/inc/LibraryIncludes.h index b9df47f957..728246e1c9 100644 --- a/src/inc/LibraryIncludes.h +++ b/src/inc/LibraryIncludes.h @@ -84,8 +84,18 @@ // {fmt}, a C++20-compatible formatting library #pragma warning(push) #pragma warning(disable: 4702) // unreachable code +// Workaround: clang-cl advertises consteval support but fmt's use of it in +// color.h triggers "call to consteval function is not a constant expression". +// Hide __cpp_lib_is_constant_evaluated so fmt falls back to the non-consteval path. +#ifdef __clang__ +#pragma push_macro("__cpp_lib_is_constant_evaluated") +#undef __cpp_lib_is_constant_evaluated +#endif #include #include +#ifdef __clang__ +#pragma pop_macro("__cpp_lib_is_constant_evaluated") +#endif #pragma warning(pop) #define USE_INTERVAL_TREE_NAMESPACE diff --git a/src/project.inc b/src/project.inc index 152aca2717..cf4a2e048c 100644 --- a/src/project.inc +++ b/src/project.inc @@ -35,7 +35,8 @@ USE_NATIVE_EH = 1 USE_STD_CPP20 = 1 MSC_WARNING_LEVEL = /W4 /WX -USER_C_FLAGS = $(USER_C_FLAGS) /Zc:preprocessor /fp:contract /utf-8 +USER_C_FLAGS = $(USER_C_FLAGS) /fp:contract /utf-8 +ZC_PREPROCESSOR = 1 # ------------------------------------- # Common Console Includes and Libraries diff --git a/src/renderer/atlas/pch.h b/src/renderer/atlas/pch.h index 952d0fb2d7..9d5bc66515 100644 --- a/src/renderer/atlas/pch.h +++ b/src/renderer/atlas/pch.h @@ -46,8 +46,18 @@ // {fmt}, a C++20-compatible formatting library #pragma warning(push) #pragma warning(disable : 4702) // unreachable code +// Workaround: clang-cl advertises consteval support but fmt's use of it in +// color.h triggers "call to consteval function is not a constant expression". +// Hide __cpp_lib_is_constant_evaluated so fmt falls back to the non-consteval path. +#ifdef __clang__ +#pragma push_macro("__cpp_lib_is_constant_evaluated") +#undef __cpp_lib_is_constant_evaluated +#endif #include #include +#ifdef __clang__ +#pragma pop_macro("__cpp_lib_is_constant_evaluated") +#endif #pragma warning(pop) #include