-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang 14's <stdatomic.h>
is incompatible with MSVC's <stdatomic.h>
☢️
#2862
Comments
They have many macros: #define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
#define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
.... and we have real functions instead of macros in extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept {
::_Atomic_thread_fence(static_cast<unsigned int>(_Order));
}
.... and then macro replaces to
but I prepared a patch: https://reviews.llvm.org/D130419 |
They landed the patch : llvm/llvm-project@ba49d39 |
Speaking of |
Yes, DevCom-1204057 |
Thanks! Guess I was searching wrong (under "visual studio" instead of under "C++"). |
You're welcome. FYI the patch landed before LLVM 15 was branched. So the fix will be in Clang-15. |
This repros with Clang 14, when the STL's tests are compiled with the official toolset (instead of the microsoft/STL repo - the difference is in the header locations, because Clang overrides toolset headers).
tests/std/tests/P0943R6_stdatomic_h/test.compile.pass.cpp
and the many tests includingstl/inc/__msvc_all_public_headers.hpp
fail due to Clang's<stdatomic.h>
, like this:As a workaround, we're going to avoid including
<stdatomic.h>
for Clang, but solving the root cause would be better.The text was updated successfully, but these errors were encountered: