[libcxx-commits] [libcxx] [libc++] Replace hardcoded table_size with CHAR_BIT calculation (PR #160008)

Fady Farag via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 22 10:12:16 PDT 2025


https://github.com/iidmsa updated https://github.com/llvm/llvm-project/pull/160008

>From 9b659facad22ede446756f6883e0125532c75452 Mon Sep 17 00:00:00 2001
From: Fady Farag <com.idmsa at gmail.com>
Date: Sun, 21 Sep 2025 15:05:51 -0500
Subject: [PATCH] [libc++] Remove outdated FIXME comment in ctype<char>

The FIXME comment about not hardcoding table_size is unclear about its
original intent.
---
 libcxx/include/__cxx03/__locale | 2 +-
 libcxx/include/__locale         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/include/__cxx03/__locale b/libcxx/include/__cxx03/__locale
index 86160bcdcbd59..70dd1e65cfba9 100644
--- a/libcxx/include/__cxx03/__locale
+++ b/libcxx/include/__cxx03/__locale
@@ -578,7 +578,7 @@ public:
 #ifdef _CACHED_RUNES
   static const size_t table_size = _CACHED_RUNES;
 #else
-  static const size_t table_size = 256; // FIXME: Don't hardcode this.
+  static const size_t table_size = 256;
 #endif
   _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }
   static const mask* classic_table() _NOEXCEPT;
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 757a53951f66e..eb7b7786208e8 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -585,7 +585,7 @@ public:
 #  ifdef _CACHED_RUNES
   static const size_t table_size = _CACHED_RUNES;
 #  else
-  static const size_t table_size = 256; // FIXME: Don't hardcode this.
+  static const size_t table_size = 256;
 #  endif
   _LIBCPP_HIDE_FROM_ABI const mask* table() const _NOEXCEPT { return __tab_; }
   static const mask* classic_table() _NOEXCEPT;



More information about the libcxx-commits mailing list