[libcxx-commits] [libcxx] 818cfb1 - [libcxx][test] Make MSVC `<charconv>` test compile when testing MSVC
Casey Carter via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jan 23 10:13:02 PST 2022
Author: Casey Carter
Date: 2022-01-23T10:12:53-08:00
New Revision: 818cfb10c57487cd9c8b57d8136d9e42b31a50aa
URL: https://github.com/llvm/llvm-project/commit/818cfb10c57487cd9c8b57d8136d9e42b31a50aa
DIFF: https://github.com/llvm/llvm-project/commit/818cfb10c57487cd9c8b57d8136d9e42b31a50aa.diff
LOG: [libcxx][test] Make MSVC `<charconv>` test compile when testing MSVC
<meme>How many layers of irony are you on?</meme>
Differential Revision: https://reviews.llvm.org/D117967
Added:
Modified:
libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp b/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
index 66854205937a2..1c4cdb9558b38 100644
--- a/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
+++ b/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
@@ -31,6 +31,10 @@
# define sprintf_s snprintf
#endif
+#ifdef _MSVC_STL_VERSION
+#include <xutility>
+using std::_Bit_cast;
+#else
// FUNCTION TEMPLATE _Bit_cast
template <class _To, class _From,
std::enable_if_t<sizeof(_To) == sizeof(_From) && std::is_trivially_copyable_v<_To> &&
@@ -39,6 +43,7 @@ template <class _To, class _From,
[[nodiscard]] constexpr _To _Bit_cast(const _From& _From_obj) noexcept {
return __builtin_bit_cast(_To, _From_obj);
}
+#endif
// Includes Microsoft's test that tests the entire header.
More information about the libcxx-commits
mailing list