File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1217,23 +1217,22 @@ private:
1217
1217
__assign_value ( __get_node_value_type_t <value_type>& __lhs, _From&& __rhs) {
1218
1218
using __key_type = __remove_const_t <typename value_type::first_type>;
1219
1219
1220
- if (
1221
- (
1222
- _LIBCPP_STD_VER >= 26
1223
- )
1224
- &&
1225
- __libcpp_is_constant_evaluated ()) {
1220
+
1221
+ #if _LIBCPP_STD_VER >= 26
1222
+ if (__libcpp_is_constant_evaluated ()) {
1226
1223
using __node_value_type = __get_node_value_type_t <value_type>;
1227
1224
__get_node_value_type_t <value_type> __tmp (__rhs.first , __rhs.second );
1228
1225
// const_cast is not allowed at constexpr time.
1229
1226
// we get around this by deleting and creating a new node value
1230
1227
// note: this does not work for `const MoveOnly` keys at constexpr time
1231
- __lhs.~__node_value_type ();
1228
+
1229
+ // __lhs.~__node_value_type();
1232
1230
__node_allocator& __na = __node_alloc ();
1233
1231
__node_traits::destroy (__na, std::addressof (__lhs));
1234
- // Fails here for `std/containers/associative/map/map.cons/move_assign.pass.cpp`
1235
1232
__node_traits::construct (__na, std::addressof (__lhs), std::move (__tmp));
1236
- } else {
1233
+ } else
1234
+ #endif
1235
+ {
1237
1236
// This is technically UB, since the object was constructed as `const`.
1238
1237
// Clang doesn't optimize on this currently though.
1239
1238
const_cast <__key_type&>(__lhs.first ) = const_cast <__copy_cvref_t <_From, __key_type>&&>(__rhs.first );
You can’t perform that action at this time.
0 commit comments