Run clang-tidy modernize-use-equals-{delete,default} on //base
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md
In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
git diff --name-only | \
xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'
BUG=778959,778957
Change-Id: I95a3f3dae4796e4a7beb77793a6101f433a2c649
Reviewed-on: https://chromium-review.googlesource.com/789718
Reviewed-by: Daniel Cheng <[email protected]>
Commit-Queue: Chris Watkins <[email protected]>
Cr-Commit-Position: refs/heads/master@{#520033}
diff --git a/base/tuple_unittest.cc b/base/tuple_unittest.cc
index 730985c..321c549 100644
--- a/base/tuple_unittest.cc
+++ b/base/tuple_unittest.cc
@@ -16,14 +16,14 @@
}
struct Addy {
- Addy() { }
+ Addy() = default;
void DoAdd(int a, int b, int c, int d, int* res) {
*res = a + b + c + d;
}
};
struct Addz {
- Addz() { }
+ Addz() = default;
void DoAdd(int a, int b, int c, int d, int e, int* res) {
*res = a + b + c + d + e;
}
@@ -68,7 +68,7 @@
struct CopyLogger {
CopyLogger() { ++TimesConstructed; }
CopyLogger(const CopyLogger& tocopy) { ++TimesConstructed; ++TimesCopied; }
- ~CopyLogger() { }
+ ~CopyLogger() = default;
static int TimesCopied;
static int TimesConstructed;