Skip to content

Commit e2f3b8f

Browse files
move alloc failure location
1 parent 01d8633 commit e2f3b8f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

libcxx/include/__tree

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,20 @@ public:
11571157
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
11581158
__insert_unique_from_orphaned_node(const_iterator __p, __get_node_value_type_t<_Tp>&& __value) {
11591159
using __key_type = typename _NodeTypes::key_type;
1160-
__emplace_hint_unique(__p, const_cast<__key_type&&>(__value.first), std::move(__value.second));
1160+
// fails here for move_alloc.pass.cpp
1161+
// if(std::is_constant_evaluated()) {
1162+
// // TODO: use a better name
1163+
// using foo_type = __get_node_value_type_t<_Tp>;
1164+
// // foo_type tmp {__value.first, __value.second};
1165+
// // __value.~foo_type();
1166+
// // new (std::addressof(__value))(foo_type)(tmp);
1167+
// // __emplace_hint_unique(__p, tmp);
1168+
// __key_type kk;
1169+
// new (std::addressof(kk))(__key_type)(__value.first);
1170+
// __emplace_hint_unique(__p, std::move(kk), std::move(__value.second));
1171+
// } else {
1172+
__emplace_hint_unique(__p, const_cast<__key_type&&>(__value.first), std::move(__value.second));
1173+
// }
11611174
}
11621175

11631176
template <class _ValueT = _Tp, __enable_if_t<!__is_tree_value_type<_ValueT>::value, int> = 0>

0 commit comments

Comments
 (0)