[libcxx-commits] [libcxx] [libc++] Remove locale::id::__next_id from the ABI (PR #210360)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 21 02:09:09 PDT 2026


================
@@ -562,11 +562,10 @@ void locale::facet::__on_zero_shared() noexcept { delete this; }
 
 // locale::id
 
-constinit int32_t locale::id::__next_id = 0;
-
 long locale::id::__get() {
-  call_once(__flag_, [&] { __id_ = __libcpp_atomic_add(&__next_id, 1); });
-  return __id_ - 1;
+  constinit static atomic<int32_t> next_id = 0;
----------------
philnik777 wrote:

Urgh, that's some horrible naming and confusing semantics. Switching back to the original version for now, but this should definitely be cleaned up.

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


More information about the libcxx-commits mailing list