summaryrefslogtreecommitdiff
path: root/include/__tree
diff options
context:
space:
mode:
Diffstat (limited to 'include/__tree')
-rw-r--r--include/__tree6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/__tree b/include/__tree
index bfcec78d4c9b..b560bf071e81 100644
--- a/include/__tree
+++ b/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) {}