[libcxx-commits] [libcxx] [libc++] Remove UB from std::map __tree_node construction (PR #153908)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 18 02:02:32 PDT 2025


================
@@ -1416,7 +1416,7 @@ multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_t
   if (__a != __s.get_allocator()) {
     const_iterator __e = cend();
     while (!__s.empty())
-      insert(__e, std::move(__s.__tree_.remove(__s.begin())->__value_));
+      insert(__e, std::move(__s.__tree_.remove(__s.begin())->__get_value()));
----------------
philnik777 wrote:

You mean nothing complained when you made `__value_` private? If that is the case we're definitely missing tests. Please file a bug about it or add some tests yourself. The latter would be appreciated, but not necessary.

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


More information about the libcxx-commits mailing list