diff options
Diffstat (limited to 'libcxx/include/__tree')
| -rw-r--r-- | libcxx/include/__tree | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcxx/include/__tree b/libcxx/include/__tree index bfcec78d4c9..b560bf071e8 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -1419,7 +1419,11 @@ private: _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __tree& __t, true_type) - {__node_alloc() = __t.__node_alloc();} + { + if (__node_alloc() != __t.__node_alloc()) + clear(); + __node_alloc() = __t.__node_alloc(); + } _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __tree& __t, false_type) {} |

