[libcxx-commits] [libcxx] [libc++] Remove UB from std::map __tree_node construction (PR #153908)
Vinay Deshmukh via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 16 09:33:06 PDT 2025
================
@@ -1808,7 +1842,7 @@ typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&&... __args) {
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, std::addressof(__h->__value_), std::forward<_Args>(__args)...);
+ std::__construct_at(std::addressof(*__h), __na, std::forward<_Args>(__args)...);
----------------
vinay-deshmukh wrote:
N.B. This is the line that prompts this change due to needing workarounds when implementing P3372 for map (Add `constexpr`)
https://github.com/llvm/llvm-project/pull/153908
More information about the libcxx-commits
mailing list