[libcxx-commits] [PATCH] D120317: [libcxx] [test] Fix get/put long_double_ru_RU on Glibc, FreeBSD and Windows

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 2 13:01:20 PST 2022


Quuxplusone requested changes to this revision.
Quuxplusone added a comment.
This revision now requires changes to proceed.

Let's do one more round, just to see if `MultiStringType` is useful.



================
Comment at: libcxx/test/support/locale_helpers.h:74
+
+std::string currency_symbol_ru_RU() {
+#if defined(_CS_GNU_LIBC_VERSION)
----------------
I wonder if you could use `MultiStringType` instead of `std::string` here, and then you wouldn't need to repeat yourself on lines 90-108.


================
Comment at: libcxx/test/support/locale_helpers.h:76-82
+  // GLIBC <= 2.23 uses currency_symbol="<U0440><U0443><U0431>"
+  // GLIBC >= 2.24 uses currency_symbol="<U20BD>"
+  // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm
+  if (!glibc_version_less_than("2.24"))
+    return "\u20BD";
+  else
+    return "\u0440\u0443\u0431";
----------------
The comments are just repeating what the code says.
(The only reason I don't also comment on the `"\u0440\u0443\u0431"` line is that I can't think of a short yet enlightening comment to put, except for `// "руб"`, and I don't want to encourage non-ASCII comments.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120317



More information about the libcxx-commits mailing list