[libcxx-commits] [libcxx] [libc++] Granularize <__locale> into __locale_dir (PR #213667)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 3 06:28:32 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

The <__locale> header was a collection of distinct utilities. This patch splits it up into granular headers under __locale_dir/. This patch however does not use the granular headers from users of <__locale>: this will be done in a separate patch.

Assisted by Claude

---

Patch is 111.34 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/213667.diff


9 Files Affected:

- (modified) libcxx/include/CMakeLists.txt (+6) 
- (modified) libcxx/include/__locale (+6-1412) 
- (added) libcxx/include/__locale_dir/codecvt.h (+576) 
- (added) libcxx/include/__locale_dir/collate.h (+151) 
- (added) libcxx/include/__locale_dir/ctype.h (+316) 
- (added) libcxx/include/__locale_dir/ctype_base.h (+189) 
- (added) libcxx/include/__locale_dir/locale.h (+191) 
- (added) libcxx/include/__locale_dir/utf8_conversions.h (+177) 
- (modified) libcxx/include/module.modulemap.in (+9-1) 


``````````diff
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 5034d5f6fe95b..31c6177bc0b84 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -536,7 +536,12 @@ set(files
   __iterator/wrap_iter.h
   __locale
   __locale_dir/check_grouping.h
+  __locale_dir/codecvt.h
+  __locale_dir/collate.h
+  __locale_dir/ctype.h
+  __locale_dir/ctype_base.h
   __locale_dir/get_c_locale.h
+  __locale_dir/locale.h
   __locale_dir/locale_base_api.h
   __locale_dir/locale_base_api/bsd_locale_fallbacks.h
   __locale_dir/locale_base_api/ibm.h
@@ -561,6 +566,7 @@ set(files
   __locale_dir/support/openbsd.h
   __locale_dir/support/windows.h
   __locale_dir/time.h
+  __locale_dir/utf8_conversions.h
   __locale_dir/wbuffer_convert.h
   __locale_dir/wstring_convert.h
   __log_hardening_failure
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index d5dafc6c65f30..c4b74aee4fb17 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -11,1426 +11,20 @@
 #define _LIBCPP___LOCALE
 
 #include <__config>
-#include <__configuration/availability.h>
-#include <__configuration/platform.h>
 
 #if _LIBCPP_HAS_LOCALIZATION
 
-#  include <__fwd/ios.h>
-#  include <__locale_dir/locale_base_api.h>
-#  include <__memory/addressof.h>
-#  include <__memory/shared_count.h>
-#  include <__mutex/once_flag.h>
-#  include <__type_traits/make_unsigned.h>
-#  include <__utility/no_destroy.h>
-#  include <__utility/private_constructor_tag.h>
-#  include <cctype>
-#  include <clocale>
-#  include <cstdint>
-#  include <cstdlib>
-#  include <stdexcept>
-#  include <string>
-#  include <text_encoding>
-
-// Some platforms require more includes than others. Keep the includes on all plaforms for now.
-#  include <cstddef>
-#  include <cstring>
-
-#  if _LIBCPP_HAS_WIDE_CHARACTERS
-#    include <cwchar>
-#  else
-#    include <__std_mbstate_t.h>
-#  endif
+#  include <__locale_dir/codecvt.h>
+#  include <__locale_dir/collate.h>
+#  include <__locale_dir/ctype.h>
+#  include <__locale_dir/ctype_base.h>
+#  include <__locale_dir/locale.h>
+#  include <__locale_dir/utf8_conversions.h>
 
 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #    pragma GCC system_header
 #  endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
-
-class _LIBCPP_EXPORTED_FROM_ABI locale;
-
-template <class _CharT>
-class collate;
-
-template <class _Facet>
-_LIBCPP_HIDE_FROM_ABI bool has_facet(const locale&) _NOEXCEPT;
-
-template <class _Facet>
-_LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale&);
-
-class _LIBCPP_EXPORTED_FROM_ABI locale {
-public:
-  // locale is essentially a shared_ptr that doesn't support weak_ptrs and never got a move constructor,
-  // so it is trivially relocatable.
-  using __trivially_relocatable _LIBCPP_NODEBUG = locale;
-
-  // types:
-  class _LIBCPP_EXPORTED_FROM_ABI facet;
-  class _LIBCPP_EXPORTED_FROM_ABI id;
-
-  typedef int category;
-
-  static const category // values assigned here are for exposition only
-      none    = 0,
-      collate = _LIBCPP_COLLATE_MASK, ctype = _LIBCPP_CTYPE_MASK, monetary = _LIBCPP_MONETARY_MASK,
-      numeric = _LIBCPP_NUMERIC_MASK, time = _LIBCPP_TIME_MASK, messages = _LIBCPP_MESSAGES_MASK,
-      all = collate | ctype | monetary | numeric | time | messages;
-
-  // construct/copy/destroy:
-  locale() _NOEXCEPT;
-  locale(const locale&) _NOEXCEPT;
-  explicit locale(const char*);
-  explicit locale(const string&);
-  locale(const locale&, const char*, category);
-  locale(const locale&, const string&, category);
-  template <class _Facet>
-  _LIBCPP_HIDE_FROM_ABI locale(const locale&, _Facet*);
-  locale(const locale&, const locale&, category);
-
-  ~locale();
-
-  const locale& operator=(const locale&) _NOEXCEPT;
-
-  template <class _Facet>
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI locale combine(const locale& __other) const {
-    if (!std::has_facet<_Facet>(__other))
-      __throw_runtime_error("locale::combine: locale missing facet");
-
-    return locale(*this, std::addressof(const_cast<_Facet&>(std::use_facet<_Facet>(__other))));
-  }
-
-  // locale operations:
-  [[__nodiscard__]] string name() const;
-  bool operator==(const locale&) const;
-#  if _LIBCPP_STD_VER <= 17
-  _LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const { return !(*this == __y); }
-#  endif
-  template <class _CharT, class _Traits, class _Allocator>
-  [[__nodiscard__]]
-  _LIBCPP_HIDE_FROM_ABI bool operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
-                                        const basic_string<_CharT, _Traits, _Allocator>& __y) const {
-    return std::use_facet<std::collate<_CharT> >(*this).compare(
-               __x.data(), __x.data() + __x.size(), __y.data(), __y.data() + __y.size()) < 0;
-  }
-#  if _LIBCPP_STD_VER >= 26
-  [[nodiscard]] _LIBCPP_AVAILABILITY_TEXT_ENCODING_ENVIRONMENT
-      _LIBCPP_HIDE_FROM_ABI std::text_encoding encoding() const {
-    std::string __name = name();
-    return std::__get_locale_encoding(__name.c_str());
-  }
-#  endif
-
-  // global locale objects:
-  static locale global(const locale&);
-  [[__nodiscard__]] static const locale& classic();
-
-private:
-  class __imp;
-  __imp* __locale_;
-
-  template <class>
-  friend struct __no_destroy;
-
-  friend ios_base;
-
-  _LIBCPP_HIDE_FROM_ABI explicit locale(__private_constructor_tag, __imp* __loc) : __locale_(__loc) {}
-
-  void __install_ctor(const locale&, facet*, long);
-  static locale& __global();
-  bool has_facet(id&) const;
-  const facet* use_facet(id&) const;
-
-  template <class _Facet>
-  friend bool has_facet(const locale&) _NOEXCEPT;
-  template <class _Facet>
-  friend const _Facet& use_facet(const locale&);
-};
-
-class _LIBCPP_EXPORTED_FROM_ABI locale::facet : public __shared_count {
-protected:
-  _LIBCPP_HIDE_FROM_ABI explicit facet(size_t __refs = 0) : __shared_count(static_cast<long>(__refs) - 1) {}
-
-  ~facet() override;
-
-  //    facet(const facet&) = delete;     // effectively done in __shared_count
-  //    void operator=(const facet&) = delete;
-
-private:
-  void __on_zero_shared() _NOEXCEPT override;
-};
-
-class _LIBCPP_EXPORTED_FROM_ABI locale::id {
-  once_flag __flag_;
-  int32_t __id_;
-
-public:
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR id() : __id_(0) {}
-  void operator=(const id&) = delete;
-  id(const id&)             = delete;
-
-public: // only needed for tests
-  long __get();
-
-  friend class locale;
-  friend class locale::__imp;
-};
-
-template <class _Facet>
-inline _LIBCPP_HIDE_FROM_ABI locale::locale(const locale& __other, _Facet* __f) {
-  __install_ctor(__other, __f, __f ? __f->id.__get() : 0);
-}
-
-template <class _Facet>
-[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI bool has_facet(const locale& __l) _NOEXCEPT {
-  return __l.has_facet(_Facet::id);
-}
-
-template <class _Facet>
-[[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI const _Facet& use_facet(const locale& __l) {
-  return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
-}
-
-// template <class _CharT> class collate;
-
-template <class _CharT>
-class collate : public locale::facet {
-public:
-  typedef _CharT char_type;
-  typedef basic_string<char_type> string_type;
-
-  _LIBCPP_HIDE_FROM_ABI explicit collate(size_t __refs = 0) : locale::facet(__refs) {}
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI int
-  compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const {
-    return do_compare(__lo1, __hi1, __lo2, __hi2);
-  }
-
-  // FIXME(EricWF): The _LIBCPP_ALWAYS_INLINE is needed on Windows to work
-  // around a dllimport bug that expects an external instantiation.
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE string_type
-  transform(const char_type* __lo, const char_type* __hi) const {
-    return do_transform(__lo, __hi);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI long hash(const char_type* __lo, const char_type* __hi) const {
-    return do_hash(__lo, __hi);
-  }
-
-  static locale::id id;
-
-protected:
-  ~collate() override;
-  virtual int
-  do_compare(const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const;
-  virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const {
-    return string_type(__lo, __hi);
-  }
-  virtual long do_hash(const char_type* __lo, const char_type* __hi) const;
-};
-
-template <class _CharT>
-locale::id collate<_CharT>::id;
-
-template <class _CharT>
-collate<_CharT>::~collate() {}
-
-template <class _CharT>
-int collate<_CharT>::do_compare(
-    const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const {
-  for (; __lo2 != __hi2; ++__lo1, ++__lo2) {
-    if (__lo1 == __hi1 || *__lo1 < *__lo2)
-      return -1;
-    if (*__lo2 < *__lo1)
-      return 1;
-  }
-  return __lo1 != __hi1;
-}
-
-template <class _CharT>
-long collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const {
-  size_t __h          = 0;
-  const size_t __sr   = __CHAR_BIT__ * sizeof(size_t) - 8;
-  const size_t __mask = size_t(0xF) << (__sr + 4);
-  for (const char_type* __p = __lo; __p != __hi; ++__p) {
-    __h        = (__h << 4) + static_cast<size_t>(*__p);
-    size_t __g = __h & __mask;
-    __h ^= __g | (__g >> __sr);
-  }
-  return static_cast<long>(__h);
-}
-
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>;
-#  if _LIBCPP_HAS_WIDE_CHARACTERS
-extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>;
-#  endif
-
-// template <class CharT> class collate_byname;
-
-template <class _CharT>
-class collate_byname;
-
-template <>
-class _LIBCPP_EXPORTED_FROM_ABI collate_byname<char> : public collate<char> {
-  __locale::__locale_t __l_;
-
-public:
-  typedef char char_type;
-  typedef basic_string<char_type> string_type;
-
-  explicit collate_byname(const char* __n, size_t __refs = 0);
-  explicit collate_byname(const string& __n, size_t __refs = 0);
-
-protected:
-  ~collate_byname() override;
-  int do_compare(
-      const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const override;
-  string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
-};
-
-#  if _LIBCPP_HAS_WIDE_CHARACTERS
-template <>
-class _LIBCPP_EXPORTED_FROM_ABI collate_byname<wchar_t> : public collate<wchar_t> {
-  __locale::__locale_t __l_;
-
-public:
-  typedef wchar_t char_type;
-  typedef basic_string<char_type> string_type;
-
-  explicit collate_byname(const char* __n, size_t __refs = 0);
-  explicit collate_byname(const string& __n, size_t __refs = 0);
-
-protected:
-  ~collate_byname() override;
-
-  int do_compare(
-      const char_type* __lo1, const char_type* __hi1, const char_type* __lo2, const char_type* __hi2) const override;
-  string_type do_transform(const char_type* __lo, const char_type* __hi) const override;
-};
-#  endif
-
-// template <class charT> class ctype
-
-class _LIBCPP_EXPORTED_FROM_ABI ctype_base {
-public:
-#  if defined(_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE)
-  typedef unsigned long mask;
-  static const mask space  = 1 << 0;
-  static const mask print  = 1 << 1;
-  static const mask cntrl  = 1 << 2;
-  static const mask upper  = 1 << 3;
-  static const mask lower  = 1 << 4;
-  static const mask alpha  = 1 << 5;
-  static const mask digit  = 1 << 6;
-  static const mask punct  = 1 << 7;
-  static const mask xdigit = 1 << 8;
-  static const mask blank  = 1 << 9;
-#    if defined(__BIONIC__)
-  // Historically this was a part of regex_traits rather than ctype_base. The
-  // historical value of the constant is preserved for ABI compatibility.
-  static const mask __regex_word = 0x8000;
-#    else
-  static const mask __regex_word = 1 << 10;
-#    endif // defined(__BIONIC__)
-#  elif defined(__GLIBC__)
-  typedef unsigned short mask;
-  _LIBCPP_DIAGNOSTIC_PUSH
-  _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wmodules-ambiguous-internal-linkage")
-  static const mask space  = _ISspace;
-  static const mask print  = _ISprint;
-  static const mask cntrl  = _IScntrl;
-  static const mask upper  = _ISupper;
-  static const mask lower  = _ISlower;
-  static const mask alpha  = _ISalpha;
-  static const mask digit  = _ISdigit;
-  static const mask punct  = _ISpunct;
-  static const mask xdigit = _ISxdigit;
-  static const mask blank  = _ISblank;
-  _LIBCPP_DIAGNOSTIC_POP
-#    if defined(__mips__) || defined(_LIBCPP_BIG_ENDIAN)
-  static const mask __regex_word = static_cast<mask>(_ISbit(15));
-#    else
-  static const mask __regex_word = 0x80;
-#    endif
-#  elif defined(_WIN32)
-  typedef unsigned short mask;
-  static const mask space        = _SPACE;
-  static const mask print        = _BLANK | _PUNCT | _ALPHA | _DIGIT;
-  static const mask cntrl        = _CONTROL;
-  static const mask upper        = _UPPER;
-  static const mask lower        = _LOWER;
-  static const mask alpha        = _ALPHA;
-  static const mask digit        = _DIGIT;
-  static const mask punct        = _PUNCT;
-  static const mask xdigit       = _HEX;
-  static const mask blank        = _BLANK;
-  static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used
-#    define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
-#    define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
-#  elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
-#    ifdef __APPLE__
-  typedef uint32_t mask;
-#    elif defined(__FreeBSD__)
-  typedef unsigned long mask;
-#    elif defined(__NetBSD__)
-  typedef unsigned short mask;
-#    endif
-  static const mask space  = _CTYPE_S;
-  static const mask print  = _CTYPE_R;
-  static const mask cntrl  = _CTYPE_C;
-  static const mask upper  = _CTYPE_U;
-  static const mask lower  = _CTYPE_L;
-  static const mask alpha  = _CTYPE_A;
-  static const mask digit  = _CTYPE_D;
-  static const mask punct  = _CTYPE_P;
-  static const mask xdigit = _CTYPE_X;
-
-#    if defined(__NetBSD__)
-  static const mask blank = _CTYPE_BL;
-  // NetBSD defines classes up to 0x2000
-  // see sys/ctype_bits.h, _CTYPE_Q
-  static const mask __regex_word = 0x8000;
-#    else
-  static const mask blank        = _CTYPE_B;
-  static const mask __regex_word = 0x80;
-#    endif
-#  elif defined(_AIX)
-  typedef unsigned int mask;
-  static const mask space        = _ISSPACE;
-  static const mask print        = _ISPRINT;
-  static const mask cntrl        = _ISCNTRL;
-  static const mask upper        = _ISUPPER;
-  static const mask lower        = _ISLOWER;
-  static const mask alpha        = _ISALPHA;
-  static const mask digit        = _ISDIGIT;
-  static const mask punct        = _ISPUNCT;
-  static const mask xdigit       = _ISXDIGIT;
-  static const mask blank        = _ISBLANK;
-  static const mask __regex_word = 0x8000;
-#  elif _LIBCPP_LIBC_NEWLIB
-  // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
-  typedef char mask;
-  // In case char is signed, static_cast is needed to avoid warning on
-  // positive value becomming negative.
-  static const mask space  = static_cast<mask>(_S);
-  static const mask print  = static_cast<mask>(_P | _U | _L | _N | _B);
-  static const mask cntrl  = static_cast<mask>(_C);
-  static const mask upper  = static_cast<mask>(_U);
-  static const mask lower  = static_cast<mask>(_L);
-  static const mask alpha  = static_cast<mask>(_U | _L);
-  static const mask digit  = static_cast<mask>(_N);
-  static const mask punct  = static_cast<mask>(_P);
-  static const mask xdigit = static_cast<mask>(_X | _N);
-  static const mask blank  = static_cast<mask>(_B);
-  // mask is already fully saturated, use a different type in regex_type_traits.
-  static const unsigned short __regex_word = 0x100;
-#    define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
-#    define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
-#    define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
-#  elif defined(__MVS__)
-#    if defined(__NATIVE_ASCII_F)
-  typedef unsigned int mask;
-  static const mask space  = _ISSPACE_A;
-  static const mask print  = _ISPRINT_A;
-  static const mask cntrl  = _ISCNTRL_A;
-  static const mask upper  = _ISUPPER_A;
-  static const mask lower  = _ISLOWER_A;
-  static const mask alpha  = _ISALPHA_A;
-  static const mask digit  = _ISDIGIT_A;
-  static const mask punct  = _ISPUNCT_A;
-  static const mask xdigit = _ISXDIGIT_A;
-  static const mask blank  = _ISBLANK_A;
-#    else
-  typedef unsigned short mask;
-  static const mask space  = __ISSPACE;
-  static const mask print  = __ISPRINT;
-  static const mask cntrl  = __ISCNTRL;
-  static const mask upper  = __ISUPPER;
-  static const mask lower  = __ISLOWER;
-  static const mask alpha  = __ISALPHA;
-  static const mask digit  = __ISDIGIT;
-  static const mask punct  = __ISPUNCT;
-  static const mask xdigit = __ISXDIGIT;
-  static const mask blank  = __ISBLANK;
-#    endif
-  static const mask __regex_word = 0x8000;
-#  else
-#    error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE?
-#  endif
-  static const mask alnum = alpha | digit;
-  static const mask graph = alnum | punct;
-
-  _LIBCPP_HIDE_FROM_ABI ctype_base() {}
-
-  static_assert((__regex_word & ~(std::make_unsigned<mask>::type)(space | print | cntrl | upper | lower | alpha |
-                                                                  digit | punct | xdigit | blank)) == __regex_word,
-                "__regex_word can't overlap other bits");
-};
-
-template <class _CharT>
-class ctype;
-
-#  if _LIBCPP_HAS_WIDE_CHARACTERS
-template <>
-class _LIBCPP_EXPORTED_FROM_ABI ctype<wchar_t> : public locale::facet, public ctype_base {
-public:
-  typedef wchar_t char_type;
-
-  _LIBCPP_HIDE_FROM_ABI explicit ctype(size_t __refs = 0) : locale::facet(__refs) {}
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is(mask __m, char_type __c) const { return do_is(__m, __c); }
-
-  _LIBCPP_HIDE_FROM_ABI const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const {
-    return do_is(__low, __high, __vec);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
-  scan_is(mask __m, const char_type* __low, const char_type* __high) const {
-    return do_scan_is(__m, __low, __high);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const char_type*
-  scan_not(mask __m, const char_type* __low, const char_type* __high) const {
-    return do_scan_not(__m, __low, __high);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type toupper(char_type __c) const { return do_toupper(__c); }
-
-  _LIBCPP_HIDE_FROM_ABI const char_type* toupper(char_type* __low, const char_type* __high) const {
-    return do_toupper(__low, __high);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type tolower(char_type __c) const { return do_tolower(__c); }
-
-  _LIBCPP_HIDE_FROM_ABI const char_type* tolower(char_type* __low, const char_type* __high) const {
-    return do_tolower(__low, __high);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char_type widen(char __c) const { return do_widen(__c); }
-
-  _LIBCPP_HIDE_FROM_ABI const char* widen(const char* __low, const char* __high, char_type* __to) const {
-    return do_widen(__low, __high, __to);
-  }
-
-  [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI char narrow(char_type __c, char __dfault) const {
-    return do_narrow(__c, __dfault);
-  }
-
-  _LIBCPP_HIDE_FROM_ABI const char_type*
-  narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const {
-    return do_narrow(__low, __high, __dfault, __to);
-  }
-
-  static locale::id id;
-
-protected:
-  ~ctype() override;
-  virtual bool do_is(mask __m, char_type __c) const;
-  virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const;
-  virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const;
-  virtual const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const;
-  virtual char_type do_toupper(char_type) const;
-  virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
-  virtual char_type do_tolower(char_type) const;
-  virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
-  virtual char_type do_widen(char) const;
-  virtual const char* do_widen(const char* __low, const char* __high, char_type* __dest) const;
-  virtual char do_narrow(char_type, char __dfault) const;
-  virtu...
[truncated]

``````````

</details>


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


More information about the libcxx-commits mailing list