Commit 818cfb10 authored by Casey Carter's avatar Casey Carter
Browse files

[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
parent f69379d0
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
# define sprintf_s snprintf # define sprintf_s snprintf
#endif #endif
#ifdef _MSVC_STL_VERSION
#include <xutility>
using std::_Bit_cast;
#else
// FUNCTION TEMPLATE _Bit_cast // FUNCTION TEMPLATE _Bit_cast
template <class _To, class _From, template <class _To, class _From,
std::enable_if_t<sizeof(_To) == sizeof(_From) && std::is_trivially_copyable_v<_To> && std::enable_if_t<sizeof(_To) == sizeof(_From) && std::is_trivially_copyable_v<_To> &&
...@@ -39,6 +43,7 @@ template <class _To, class _From, ...@@ -39,6 +43,7 @@ template <class _To, class _From,
[[nodiscard]] constexpr _To _Bit_cast(const _From& _From_obj) noexcept { [[nodiscard]] constexpr _To _Bit_cast(const _From& _From_obj) noexcept {
return __builtin_bit_cast(_To, _From_obj); return __builtin_bit_cast(_To, _From_obj);
} }
#endif
// Includes Microsoft's test that tests the entire header. // Includes Microsoft's test that tests the entire header.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment