Index: unittests/ADT/DenseMapTest.cpp =================================================================== --- unittests/ADT/DenseMapTest.cpp +++ unittests/ADT/DenseMapTest.cpp @@ -246,8 +246,8 @@ EXPECT_EQ(1u, copyMap.size()); EXPECT_EQ(this->getValue(), copyMap[this->getKey()]); - // test self-assignment. - copyMap = copyMap; + // test self-assignment. the cast is to avoid the warning. + copyMap = (TypeParam &)copyMap; EXPECT_EQ(1u, copyMap.size()); EXPECT_EQ(this->getValue(), copyMap[this->getKey()]); } @@ -261,8 +261,8 @@ for (int Key = 0; Key < 5; ++Key) EXPECT_EQ(this->getValue(Key), copyMap[this->getKey(Key)]); - // test self-assignment. - copyMap = copyMap; + // test self-assignment. the cast is to avoid the warning. + copyMap = (TypeParam &)copyMap; EXPECT_EQ(5u, copyMap.size()); for (int Key = 0; Key < 5; ++Key) EXPECT_EQ(this->getValue(Key), copyMap[this->getKey(Key)]); Index: unittests/ADT/SmallPtrSetTest.cpp =================================================================== --- unittests/ADT/SmallPtrSetTest.cpp +++ unittests/ADT/SmallPtrSetTest.cpp @@ -27,8 +27,8 @@ SmallPtrSet s2; (s2 = s1).insert(&buf[2]); - // Self assign as well. - (s2 = s2).insert(&buf[3]); + // Self assign as well. The cast is to avoid the warning. + (s2 = (SmallPtrSet &)s2).insert(&buf[3]); s1 = s2; EXPECT_EQ(4U, s1.size()); @@ -56,7 +56,7 @@ SmallPtrSet s; typedef SmallPtrSet::iterator iter; - + s.insert(&buf[0]); s.insert(&buf[1]); s.insert(&buf[2]); Index: unittests/ADT/SparseBitVectorTest.cpp =================================================================== --- unittests/ADT/SparseBitVectorTest.cpp +++ unittests/ADT/SparseBitVectorTest.cpp @@ -68,7 +68,7 @@ Vec.set(23); Vec.set(234); - Vec = Vec; + Vec = (SparseBitVector<> &)Vec; // the cast is to avoid the warning. EXPECT_TRUE(Vec.test(23)); EXPECT_TRUE(Vec.test(234));