[libcxx-commits] [libcxx] [libc++] Optimize num_get integral functions (PR #121795)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 10 07:33:16 PST 2025


================
@@ -83,11 +85,22 @@ struct __num_get : protected __num_get_base {
       unsigned*& __g_end,
       _CharT* __atoms);
 
-  _LIBCPP_HIDE_FROM_ABI static string __stage2_int_prep(ios_base& __iob, _CharT& __thousands_sep) {
-    locale __loc                 = __iob.getloc();
-    const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
-    __thousands_sep              = __np.thousands_sep();
-    return __np.grouping();
+  _LIBCPP_HIDE_FROM_ABI static ptrdiff_t __atoms_offset(const _CharT* __atoms, _CharT __val) {
+#  if _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS
+    if constexpr (is_same<_CharT, char>::value) {
+      _LIBCPP_DIAGNOSTIC_PUSH
+      _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpsabi") // This should be removed once https://llvm.org/PR128361 is fixed
----------------
ldionne wrote:

I think the comment should be updated to reflect that this has been fixed and can be removed when we support Clang 22 as the oldest.

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


More information about the libcxx-commits mailing list