@@ -1027,10 +1027,15 @@ public:
1027
1027
__insert_unique_from_orphaned_node (const_iterator __p, __get_node_value_type_t <_Tp>&& __value) {
1028
1028
// fails here for move_alloc.pass.cpp
1029
1029
if (__libcpp_is_constant_evaluated ()) {
1030
- __node_allocator& __na = __node_alloc ();
1031
- key_type __kk;
1032
- __node_traits::construct (__na, std::addressof (__kk), std::move (__value.first ));
1033
- __emplace_hint_unique (__p, std::move (__kk), std::move (__value.second ));
1030
+
1031
+ // using __node_value_type = __get_node_value_type_t<value_type>;
1032
+ // __get_node_value_type_t<value_type> __tmp(__value.first, __value.second);
1033
+
1034
+ // __node_allocator& __na = __node_alloc();
1035
+ // key_type __kk;
1036
+ // __node_traits::construct(__na, std::addressof(__kk), std::move(__value.first));
1037
+ // __emplace_hint_unique(__p, std::move(__kk), std::move(__value.second));
1038
+ __emplace_hint_unique (__p, std::move (__value.first ), std::move (__value.second ));
1034
1039
} else
1035
1040
{
1036
1041
__emplace_hint_unique (__p, const_cast <key_type&&>(__value.first ), std::move (__value.second ));
@@ -1210,8 +1215,8 @@ private:
1210
1215
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc (__tree&, false_type) _NOEXCEPT {}
1211
1216
1212
1217
template <class _From , class _ValueT = _Tp, __enable_if_t <__is_tree_value_type<_ValueT>::value, int > = 0 >
1213
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static void
1214
- __assign_value (__get_node_value_type_t <value_type>& __lhs, _From&& __rhs) {
1218
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1219
+ __assign_value ( __get_node_value_type_t <value_type>& __lhs, _From&& __rhs) {
1215
1220
using __key_type = __remove_const_t <typename value_type::first_type>;
1216
1221
1217
1222
if (__libcpp_is_constant_evaluated ()) {
@@ -1223,9 +1228,12 @@ private:
1223
1228
// todo: use __node_traits::construct
1224
1229
// __node_allocator& __na = __lhs.__node_alloc();
1225
1230
// __node_allocator& __na = __rhs.__node_alloc();
1226
- // __node_traits::destroy(__na, std::addressof(__lhs));
1227
- // __node_traits::construct(__na, std::addressof(__lhs), std::move(__tmp));
1228
- new (std::addressof (__lhs))(__node_value_type)(std::move (__tmp));
1231
+ __node_allocator& __na = __node_alloc ();
1232
+ __node_traits::destroy (__na, std::addressof (__lhs));
1233
+
1234
+ // __node_allocator& __na = __rhs.__node_alloc();
1235
+ __node_traits::construct (__na, std::addressof (__lhs), std::move (__tmp));
1236
+ // new (std::addressof(__lhs))(__node_value_type)(std::move(__tmp));
1229
1237
} else {
1230
1238
// This is technically UB, since the object was constructed as `const`.
1231
1239
// Clang doesn't optimize on this currently though.
@@ -1235,7 +1243,7 @@ private:
1235
1243
}
1236
1244
1237
1245
template <class _To , class _From , class _ValueT = _Tp, __enable_if_t <!__is_tree_value_type<_ValueT>::value, int > = 0 >
1238
- _LIBCPP_HIDE_FROM_ABI static void __assign_value (_To& __lhs, _From&& __rhs) {
1246
+ _LIBCPP_HIDE_FROM_ABI void __assign_value (_To& __lhs, _From&& __rhs) {
1239
1247
__lhs = std::forward<_From>(__rhs);
1240
1248
}
1241
1249
0 commit comments