[libcxx-commits] [PATCH] D119441: [libc++] Fix simple cases of locale name construction

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 15 05:24:03 PDT 2023


Mordante added a comment.

Can you add the relevant part of your reply to the commit message, that makes looking at the reason for the change easier in the future.

  Yes, because locales formed from parts of two named locales (that is, C++ locales having names) have names in turn (see C++20 subclause 28.3.1.1 [locale.general] paragraph 8). Locales with names are supposed to compare equal if their names compare equal (see C++20 subclause 28.3.1.5 [locale.operators] paragraph 1). If the implementation wants to give named locales that are formed differently the same name (*), then it is required to report that they are equal. It seems an interesting experiment in conforming but unhelpful implementation methods to retain the * and correct the equality comparison for conformance, thus we did not propose that direction for this patch.



================
Comment at: libcxx/src/locale.cpp:167
+
+    string build_name(string other, string one, locale::category c);
 };
----------------
Nit why pass by value?
Why a member function instead of a non-member function?


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

https://reviews.llvm.org/D119441



More information about the libcxx-commits mailing list