[libcxx-commits] [PATCH] D90228: [libcxx] Don't truncate intermediates to wchar_t when widening

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 27 11:25:10 PDT 2020


mstorsjo updated this revision to Diff 301064.
mstorsjo added a comment.

Rebased


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

https://reviews.llvm.org/D90228

Files:
  libcxx/include/__locale


Index: libcxx/include/__locale
===================================================================
--- libcxx/include/__locale
+++ libcxx/include/__locale
@@ -1407,7 +1407,7 @@
             if (__r == codecvt_base::error || __nn == __nb)
                 __throw_runtime_error("locale not supported");
             for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)
-                *__s = (wchar_t)*__p;
+                *__s = *__p;
             __nb = __nn;
         }
         return __s;
@@ -1441,7 +1441,7 @@
             if (__r == codecvt_base::error || __nn == __nb)
                 __throw_runtime_error("locale not supported");
             for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s)
-                *__s = (wchar_t)*__p;
+                *__s = *__p;
             __nb = __nn;
         }
         return __s;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90228.301064.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201027/f9a36d4a/attachment.bin>


More information about the libcxx-commits mailing list