Author: ericwf
Date: Wed Apr 12 20:02:41 2017
New Revision: 300154

URL: http://llvm.org/viewvc/llvm-project?rev=300154&view=rev
Log:
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.

Modified:
    libcxx/trunk/include/unordered_map

Modified: libcxx/trunk/include/unordered_map
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/unordered_map?rev=300154&r1=300153&r2=300154&view=diff
==============================================================================
--- libcxx/trunk/include/unordered_map (original)
+++ libcxx/trunk/include/unordered_map Wed Apr 12 20:02:41 2017
@@ -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));
     }
 };
 


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to