[PATCH] D45082: [RFC][unittests] ADT: silence -Wself-assign diagnostics

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 7 03:40:17 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL329491: [unittests] ADT: silence -Wself-assign diagnostics (authored by lebedevri, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45082?vs=141418&id=141482#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45082

Files:
  llvm/trunk/unittests/ADT/DenseMapTest.cpp
  llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
  llvm/trunk/unittests/ADT/SparseBitVectorTest.cpp


Index: llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
+++ llvm/trunk/unittests/ADT/SmallPtrSetTest.cpp
@@ -28,7 +28,7 @@
   (s2 = s1).insert(&buf[2]);
 
   // Self assign as well.
-  (s2 = s2).insert(&buf[3]);
+  (s2 = static_cast<SmallPtrSet<int *, 4> &>(s2)).insert(&buf[3]);
 
   s1 = s2;
   EXPECT_EQ(4U, s1.size());
@@ -56,7 +56,7 @@
 
   SmallPtrSet<int *, 4> s;
   typedef SmallPtrSet<int *, 4>::iterator iter;
-  
+
   s.insert(&buf[0]);
   s.insert(&buf[1]);
   s.insert(&buf[2]);
Index: llvm/trunk/unittests/ADT/DenseMapTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/DenseMapTest.cpp
+++ llvm/trunk/unittests/ADT/DenseMapTest.cpp
@@ -247,7 +247,7 @@
   EXPECT_EQ(this->getValue(), copyMap[this->getKey()]);
 
   // test self-assignment.
-  copyMap = copyMap;
+  copyMap = static_cast<TypeParam &>(copyMap);
   EXPECT_EQ(1u, copyMap.size());
   EXPECT_EQ(this->getValue(), copyMap[this->getKey()]);
 }
@@ -262,7 +262,7 @@
     EXPECT_EQ(this->getValue(Key), copyMap[this->getKey(Key)]);
 
   // test self-assignment.
-  copyMap = copyMap;
+  copyMap = static_cast<TypeParam &>(copyMap);
   EXPECT_EQ(5u, copyMap.size());
   for (int Key = 0; Key < 5; ++Key)
     EXPECT_EQ(this->getValue(Key), copyMap[this->getKey(Key)]);
Index: llvm/trunk/unittests/ADT/SparseBitVectorTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/SparseBitVectorTest.cpp
+++ llvm/trunk/unittests/ADT/SparseBitVectorTest.cpp
@@ -68,7 +68,7 @@
 
   Vec.set(23);
   Vec.set(234);
-  Vec = Vec;
+  Vec = static_cast<SparseBitVector<> &>(Vec);
   EXPECT_TRUE(Vec.test(23));
   EXPECT_TRUE(Vec.test(234));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45082.141482.patch
Type: text/x-patch
Size: 1814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180407/0394adbe/attachment-0001.bin>


More information about the llvm-commits mailing list