[libcxx-commits] [PATCH] D59572: Fix and speedup __libcpp_locale_guard on Windows

Shoaib Meenai via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 26 13:00:04 PDT 2019


smeenai added inline comments.


================
Comment at: include/__locale:85
+      if (__locale_all != nullptr) {
+        __setlocale(__locale_all);
+        free(__locale_all);
----------------
thomasanderson wrote:
> smeenai wrote:
> > Have you confirmed that `setlocale` does the right thing when given the semicolon-separated list of locale settings for the different categories? The docs talk about returning such a string for the `setlocale(LC_ALL, nullptr)` case, but they don't mention what happens if you try to use such a string to set the locale. https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale?view=vs-2017
> Yes, I've verified that it does have the correct behavior
Awesome, LGTM. Might be worth adding a comment to that effect, since the documentation isn't explicit about it.


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

https://reviews.llvm.org/D59572





More information about the libcxx-commits mailing list