[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
Sun Jan 23 10:13:16 PST 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG818cfb10c574: [libcxx][test] Make MSVC `<charconv>` test compile when testing MSVC (authored by CaseyCarter).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117967/new/

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.402350.patch
Type: text/x-patch
Size: 785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220123/569ed92c/attachment.bin>


More information about the libcxx-commits mailing list