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/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc
index afaebdb..96f588e6 100644
--- a/base/memory/ref_counted_unittest.cc
+++ b/base/memory/ref_counted_unittest.cc
@@ -14,7 +14,7 @@
class SelfAssign : public base::RefCounted<SelfAssign> {
protected:
- virtual ~SelfAssign() {}
+ virtual ~SelfAssign() = default;
private:
friend class base::RefCounted<SelfAssign>;
@@ -22,7 +22,7 @@
class Derived : public SelfAssign {
protected:
- ~Derived() override {}
+ ~Derived() override = default;
private:
friend class base::RefCounted<Derived>;
@@ -112,7 +112,7 @@
private:
friend class base::RefCounted<Other>;
- ~Other() {}
+ ~Other() = default;
};
class HasPrivateDestructorWithDeleter;
@@ -124,11 +124,11 @@
class HasPrivateDestructorWithDeleter
: public base::RefCounted<HasPrivateDestructorWithDeleter, Deleter> {
public:
- HasPrivateDestructorWithDeleter() {}
+ HasPrivateDestructorWithDeleter() = default;
private:
friend struct Deleter;
- ~HasPrivateDestructorWithDeleter() {}
+ ~HasPrivateDestructorWithDeleter() = default;
};
void Deleter::Destruct(const HasPrivateDestructorWithDeleter* x) {
@@ -147,11 +147,11 @@
public:
REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE();
- InitialRefCountIsOne() {}
+ InitialRefCountIsOne() = default;
private:
friend class base::RefCounted<InitialRefCountIsOne>;
- ~InitialRefCountIsOne() {}
+ ~InitialRefCountIsOne() = default;
};
} // end namespace