mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The assertions here are based around the idea that `std::atomic` is trivially constructible which is not a guarantee that the standard fully provides. The default initialization of the `std::atomic` type may leave it in an undetermined state. These were caught using the Visual C++ preview runtime. Ideally, the object constructor would use a placement new operator. However, prior to C++17, the C++ standard mandated that there be a NULL pointer check in the placement new operator. This is something which is no longer the case with C++17. Switch to the placement new operator for C++17 and newer and enable that codepath for Windows as well (which seemingly elides the null-pointer check with clang-cl).
30 KiB
30 KiB