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

@@ -1150,7 +1150,8 @@ TEST(StringTest, CanBeAssignedNonEmpty) {
TEST(StringTest, CanBeAssignedSelf) {
String dest("hello");
dest = dest;
// Use explicit function call notation here to suppress self-assign warning.
dest.operator=(dest);
EXPECT_STREQ("hello", dest.c_str());
}