summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/map
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/map')
-rw-r--r--contrib/libc++/include/map20
1 files changed, 12 insertions, 8 deletions
diff --git a/contrib/libc++/include/map b/contrib/libc++/include/map
index 009e8e2..9779b70 100644
--- a/contrib/libc++/include/map
+++ b/contrib/libc++/include/map
@@ -884,10 +884,12 @@ public:
#if __cplusplus >= 201103L
__tree_ = __m.__tree_;
#else
- __tree_.clear();
- __tree_.value_comp() = __m.__tree_.value_comp();
- __tree_.__copy_assign_alloc(__m.__tree_);
- insert(__m.begin(), __m.end());
+ if (this != &__m) {
+ __tree_.clear();
+ __tree_.value_comp() = __m.__tree_.value_comp();
+ __tree_.__copy_assign_alloc(__m.__tree_);
+ insert(__m.begin(), __m.end());
+ }
#endif
return *this;
}
@@ -1616,10 +1618,12 @@ public:
#if __cplusplus >= 201103L
__tree_ = __m.__tree_;
#else
- __tree_.clear();
- __tree_.value_comp() = __m.__tree_.value_comp();
- __tree_.__copy_assign_alloc(__m.__tree_);
- insert(__m.begin(), __m.end());
+ if (this != &__m) {
+ __tree_.clear();
+ __tree_.value_comp() = __m.__tree_.value_comp();
+ __tree_.__copy_assign_alloc(__m.__tree_);
+ insert(__m.begin(), __m.end());
+ }
#endif
return *this;
}
OpenPOWER on IntegriCloud