Swift-bundled Clang fails to build against Windows' `#include <memory>`

Related issue: clang-cl and Windows headers define conflicting versions of _m_prefetchw · Issue #87515 · llvm/llvm-project · GitHub

While trying to build out CI for SwiftNIO(-based) projects I ran into this issue on Github's windows-latest runner. Is there a known workaround known to people, or is there a path to getting the fix from LLVM 21.1.0 into Swift?

The fix described there maps to Reapply "[Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conf… · swiftlang/llvm-project@948cc91 · GitHub

Which is in the latest Swift 6.3 and main-branch nightlies.

2 Likes