commit | 792903fe9b253a845e7e7606d0cf1729a3e65575 | [log] [tgz] |
---|---|---|
author | Hans Wennborg <[email protected]> | Mon Apr 09 11:20:06 2018 |
committer | Commit Bot <[email protected]> | Mon Apr 09 11:20:06 2018 |
tree | cf9292a243a13ed6fb73b9fd02240a4a10d4e931 | |
parent | 5a80bd3ea0c54c121ff6e8daa81be11b7a5e7826 [diff] [blame] |
Defeat Clang's enhanced -Wself-assign warning In 329493, Clang's -Wself-assign warning started also firing on overloaded assignment operators. The suggested way to suppress it is to use *& on the right-hand side. This fixes the instances that fire during a debug build on Linux. TBR=jochen Bug: 830338 Change-Id: I5198ff8171462b78d55b84f58358588caf3f7fa2 Reviewed-on: https://chromium-review.googlesource.com/1000856 Commit-Queue: Hans Wennborg <[email protected]> Reviewed-by: Nico Weber <[email protected]> Cr-Commit-Position: refs/heads/master@{#549152}
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index 517c83c..eefa736 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc
@@ -187,7 +187,7 @@ TEST(GURLTest, SelfAssign) { GURL a("filesystem:http://example.com/temporary/"); // This should not crash. - a = a; + a = *&a; // The *& defeats Clang's -Wself-assign warning. } TEST(GURLTest, CopyFileSystem) {