[PATCH] D24218: [libc++] Fix support for multibyte thousands_sep and decimal_point in moneypunct_byname

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 3 18:07:32 PDT 2016


george.burgess.iv added a subscriber: george.burgess.iv.
george.burgess.iv added a comment.

Just a few drive-by nits. Thanks for the patch!


================
Comment at: src/locale.cpp:5849
@@ -5828,4 +5848,3 @@
         __decimal_point_ = base::do_decimal_point();
-    if (*lc->mon_thousands_sep)
-        __thousands_sep_ = *lc->mon_thousands_sep;
-    else
+    if (*lc->mon_thousands_sep) {
+        __thousands_sep_ = checked_string_to_char_convert(lc->mon_thousands_sep);
----------------
Are the newly-added braces necessary?

================
Comment at: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp:113
@@ -114,1 +112,3 @@
 
+// The belowe tests fail due to GLIBC's use of U00A0 as mon_decimal_point
+// and U002E as mon_decimal_point.
----------------
s/belowe/below

================
Comment at: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp:112
@@ -116,2 +111,3 @@
     }
-
+// The belowe tests fail due to GLIBC's use of U00A0 as mon_thousands_sep
+// and U002E as mon_decimal_point.
----------------
s/belowe/below/


https://reviews.llvm.org/D24218





More information about the cfe-commits mailing list