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/memory/singleton_unittest.cc b/base/memory/singleton_unittest.cc
index 1a4d901..50b862d 100644
--- a/base/memory/singleton_unittest.cc
+++ b/base/memory/singleton_unittest.cc
@@ -19,8 +19,8 @@
template <size_t alignment>
class AlignedData {
public:
- AlignedData() {}
- ~AlignedData() {}
+ AlignedData() = default;
+ ~AlignedData() = default;
alignas(alignment) char data_[alignment];
};
@@ -123,8 +123,8 @@
template <class Type>
class AlignedTestSingleton {
public:
- AlignedTestSingleton() {}
- ~AlignedTestSingleton() {}
+ AlignedTestSingleton() = default;
+ ~AlignedTestSingleton() = default;
static AlignedTestSingleton* GetInstance() {
return Singleton<AlignedTestSingleton,
StaticMemorySingletonTraits<AlignedTestSingleton>>::get();
@@ -162,7 +162,7 @@
class SingletonTest : public testing::Test {
public:
- SingletonTest() {}
+ SingletonTest() = default;
void SetUp() override {
non_leak_called_ = false;