[libcxx-commits] [libcxx] [libcxx][locale] Refactor strtonum functions using __str_to_float_c_locale<FloatT> (PR #222081)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 11 06:48:48 PDT 2026


================
@@ -307,17 +307,17 @@ _LIBCPP_HIDE_FROM_ABI _Tp __do_strtod(const char* __a, char** __p2);
 
 template <>
 inline _LIBCPP_HIDE_FROM_ABI float __do_strtod<float>(const char* __a, char** __p2) {
-  return __locale::__strtof(__a, __p2, _LIBCPP_GET_C_LOCALE);
+  return __locale::__str_to_float_c_locale<float>(__a, __p2, _LIBCPP_GET_C_LOCALE);
----------------
Himadhith wrote:

>  Do you think you could refactor that as well?

I was about to start but I see you've already started working on a patch for this, thanks for that . I went through the patch and there seems to be some ci-bot failures, if you want I can take a look into the failures. 

Ideally do we want https://github.com/llvm/llvm-project/pull/222924 to be merged as the re-factor so we can land this patch or are we happy with just the removal of `_LIBCPP_GET_C_LOCALE`? 

https://github.com/llvm/llvm-project/pull/222081


More information about the libcxx-commits mailing list