[libcxx-commits] [PATCH] D117967: [libcxx][test] Make MSVC `<charconv>` test compile when testing MSVC
Casey Carter via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 22 12:50:17 PST 2022
CaseyCarter created this revision.
CaseyCarter added a reviewer: libc++.
CaseyCarter added a project: libc++.
CaseyCarter requested review of this revision.
Herald added 1 blocking reviewer(s): libc++.
<meme>How many layers of irony are you on?</meme>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117967
Files:
libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
Index: libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
===================================================================
--- libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp
+++ 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 @@
[[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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117967.402255.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220122/875bde6e/attachment.bin>
More information about the libcxx-commits
mailing list