[libcxx-commits] [PATCH] D141263: [libc++][test] Silence MSVC warning

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 9 15:05:48 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG96f1cd2427e4: [libc++][test] Silence MSVC warning (authored by CaseyCarter).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141263

Files:
  libcxx/test/std/ranges/range.factories/range.istream.view/utils.h


Index: libcxx/test/std/ranges/range.factories/range.istream.view/utils.h
===================================================================
--- libcxx/test/std/ranges/range.factories/range.istream.view/utils.h
+++ libcxx/test/std/ranges/range.factories/range.istream.view/utils.h
@@ -6,11 +6,7 @@
 
 template <class CharT, std::size_t N>
 auto make_string(const char (&in)[N]) {
-  std::basic_string<CharT> r(N - 1, static_cast<CharT>(0));
-  for (std::size_t i = 0; i < N - 1; ++i) {
-    r[i] = static_cast<CharT>(in[i]);
-  }
-  return r;
+  return std::basic_string<CharT>(in + 0, in + (N - 1));
 }
 
 template <class CharT, std::size_t N>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141263.487570.patch
Type: text/x-patch
Size: 645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230109/85c22cd6/attachment.bin>


More information about the libcxx-commits mailing list