Fix more bad member swap definitions in unordered_map.
The __unordered_map_equal and __unordered_map_hash wrappers attempt to swap const qualified predicates whenever the predicate is empty, and is subject to the EBO. Swapping const values seems blatently incorrect. This patch removes the const qualifier so the values are swapped as non-const. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -404,7 +404,7 @@ public:
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
swap(static_cast<const _Hash&>(*this), static_cast<const _Hash&>(__y));
|
||||
swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -475,7 +475,7 @@ public:
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
swap(static_cast<const _Pred&>(*this), static_cast<const _Pred&>(__y));
|
||||
swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user