Commit 017b0df7 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Refactor base to use default members.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: Ifb940f40d4145a6074702a3d870242aeca625d96
Reviewed-on: https://chromium-review.googlesource.com/1224092Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55913}
parent 1edbf166
...@@ -21,7 +21,7 @@ StackTrace::StackTrace(const void* const* trace, size_t count) { ...@@ -21,7 +21,7 @@ StackTrace::StackTrace(const void* const* trace, size_t count) {
count_ = count; count_ = count;
} }
StackTrace::~StackTrace() {} StackTrace::~StackTrace() = default;
const void* const* StackTrace::Addresses(size_t* count) const { const void* const* StackTrace::Addresses(size_t* count) const {
*count = count_; *count = count_;
......
...@@ -125,7 +125,7 @@ class BacktraceOutputHandler { ...@@ -125,7 +125,7 @@ class BacktraceOutputHandler {
virtual void HandleOutput(const char* output) = 0; virtual void HandleOutput(const char* output) = 0;
protected: protected:
virtual ~BacktraceOutputHandler() {} virtual ~BacktraceOutputHandler() = default;
}; };
#if HAVE_EXECINFO_H #if HAVE_EXECINFO_H
...@@ -266,7 +266,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) { ...@@ -266,7 +266,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
class PrintBacktraceOutputHandler : public BacktraceOutputHandler { class PrintBacktraceOutputHandler : public BacktraceOutputHandler {
public: public:
PrintBacktraceOutputHandler() {} PrintBacktraceOutputHandler() = default;
void HandleOutput(const char* output) override { void HandleOutput(const char* output) override {
// NOTE: This code MUST be async-signal safe (it's used by in-process // NOTE: This code MUST be async-signal safe (it's used by in-process
......
...@@ -123,7 +123,7 @@ class Optional { ...@@ -123,7 +123,7 @@ class Optional {
public: public:
using value_type = T; using value_type = T;
constexpr Optional() {} constexpr Optional() = default;
constexpr Optional(base::nullopt_t) {} // NOLINT(runtime/explicit) constexpr Optional(base::nullopt_t) {} // NOLINT(runtime/explicit)
......
...@@ -15,7 +15,7 @@ class PosixDefaultTimezoneCache : public PosixTimezoneCache { ...@@ -15,7 +15,7 @@ class PosixDefaultTimezoneCache : public PosixTimezoneCache {
const char* LocalTimezone(double time_ms) override; const char* LocalTimezone(double time_ms) override;
double LocalTimeOffset(double time_ms, bool is_utc) override; double LocalTimeOffset(double time_ms, bool is_utc) override;
~PosixDefaultTimezoneCache() override {} ~PosixDefaultTimezoneCache() override = default;
}; };
} // namespace base } // namespace base
......
...@@ -15,7 +15,7 @@ class PosixTimezoneCache : public TimezoneCache { ...@@ -15,7 +15,7 @@ class PosixTimezoneCache : public TimezoneCache {
public: public:
double DaylightSavingsOffset(double time_ms) override; double DaylightSavingsOffset(double time_ms) override;
void Clear() override {} void Clear() override {}
~PosixTimezoneCache() override {} ~PosixTimezoneCache() override = default;
protected: protected:
static const int msPerSecond = 1000; static const int msPerSecond = 1000;
......
...@@ -188,7 +188,7 @@ class V8_BASE_EXPORT OS { ...@@ -188,7 +188,7 @@ class V8_BASE_EXPORT OS {
class V8_BASE_EXPORT MemoryMappedFile { class V8_BASE_EXPORT MemoryMappedFile {
public: public:
virtual ~MemoryMappedFile() {} virtual ~MemoryMappedFile() = default;
virtual void* memory() const = 0; virtual void* memory() const = 0;
virtual size_t size() const = 0; virtual size_t size() const = 0;
......
...@@ -105,10 +105,7 @@ class V8_BASE_EXPORT TimeDelta final { ...@@ -105,10 +105,7 @@ class V8_BASE_EXPORT TimeDelta final {
static TimeDelta FromTimespec(struct timespec ts); static TimeDelta FromTimespec(struct timespec ts);
struct timespec ToTimespec() const; struct timespec ToTimespec() const;
TimeDelta& operator=(const TimeDelta& other) { TimeDelta& operator=(const TimeDelta& other) = default;
delta_ = other.delta_;
return *this;
}
// Computations with other deltas. // Computations with other deltas.
TimeDelta operator+(const TimeDelta& other) const { TimeDelta operator+(const TimeDelta& other) const {
......
...@@ -49,7 +49,7 @@ class CheckedNumeric { ...@@ -49,7 +49,7 @@ class CheckedNumeric {
public: public:
typedef T type; typedef T type;
CheckedNumeric() {} CheckedNumeric() = default;
// Copy constructor. // Copy constructor.
template <typename Src> template <typename Src>
......
...@@ -27,7 +27,7 @@ class TimezoneCache { ...@@ -27,7 +27,7 @@ class TimezoneCache {
virtual void Clear() = 0; virtual void Clear() = 0;
// Called when tearing down the isolate // Called when tearing down the isolate
virtual ~TimezoneCache() {} virtual ~TimezoneCache() = default;
}; };
} // namespace base } // namespace base
......
...@@ -44,7 +44,7 @@ class FunctionalTest : public ::testing::Test { ...@@ -44,7 +44,7 @@ class FunctionalTest : public ::testing::Test {
public: public:
FunctionalTest() FunctionalTest()
: rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {} : rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {}
virtual ~FunctionalTest() {} virtual ~FunctionalTest() = default;
RandomNumberGenerator* rng() { return &rng_; } RandomNumberGenerator* rng() { return &rng_; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment