Suppresses self-assignment warnings.

This commit is contained in:
zhanyong.wan
2011-01-07 01:14:05 +00:00
parent 915129ee6f
commit 7225dd179a
3 changed files with 51 additions and 48 deletions

View File

@@ -77,7 +77,8 @@ class LinkedPtrTest : public testing::Test {
TEST_F(LinkedPtrTest, GeneralTest) {
{
linked_ptr<A> a0, a1, a2;
a0 = a0;
// Use explicit function call notation here to suppress self-assign warning.
a0.operator=(a0);
a1 = a2;
ASSERT_EQ(a0.get(), static_cast<A*>(NULL));
ASSERT_EQ(a1.get(), static_cast<A*>(NULL));