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) {
count_ = count;
}
StackTrace::~StackTrace() {}
StackTrace::~StackTrace() = default;
const void* const* StackTrace::Addresses(size_t* count) const {
*count = count_;
......
......@@ -125,7 +125,7 @@ class BacktraceOutputHandler {
virtual void HandleOutput(const char* output) = 0;
protected:
virtual ~BacktraceOutputHandler() {}
virtual ~BacktraceOutputHandler() = default;
};
#if HAVE_EXECINFO_H
......@@ -266,7 +266,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) {
class PrintBacktraceOutputHandler : public BacktraceOutputHandler {
public:
PrintBacktraceOutputHandler() {}
PrintBacktraceOutputHandler() = default;
void HandleOutput(const char* output) override {
// NOTE: This code MUST be async-signal safe (it's used by in-process
......
......@@ -123,7 +123,7 @@ class Optional {
public:
using value_type = T;
constexpr Optional() {}
constexpr Optional() = default;
constexpr Optional(base::nullopt_t) {} // NOLINT(runtime/explicit)
......
......@@ -15,7 +15,7 @@ class PosixDefaultTimezoneCache : public PosixTimezoneCache {
const char* LocalTimezone(double time_ms) override;
double LocalTimeOffset(double time_ms, bool is_utc) override;
~PosixDefaultTimezoneCache() override {}
~PosixDefaultTimezoneCache() override = default;
};
} // namespace base
......
......@@ -15,7 +15,7 @@ class PosixTimezoneCache : public TimezoneCache {
public:
double DaylightSavingsOffset(double time_ms) override;
void Clear() override {}
~PosixTimezoneCache() override {}
~PosixTimezoneCache() override = default;
protected:
static const int msPerSecond = 1000;
......
......@@ -188,7 +188,7 @@ class V8_BASE_EXPORT OS {
class V8_BASE_EXPORT MemoryMappedFile {
public:
virtual ~MemoryMappedFile() {}
virtual ~MemoryMappedFile() = default;
virtual void* memory() const = 0;
virtual size_t size() const = 0;
......
......@@ -105,10 +105,7 @@ class V8_BASE_EXPORT TimeDelta final {
static TimeDelta FromTimespec(struct timespec ts);
struct timespec ToTimespec() const;
TimeDelta& operator=(const TimeDelta& other) {
delta_ = other.delta_;
return *this;
}
TimeDelta& operator=(const TimeDelta& other) = default;
// Computations with other deltas.
TimeDelta operator+(const TimeDelta& other) const {
......
......@@ -49,7 +49,7 @@ class CheckedNumeric {
public:
typedef T type;
CheckedNumeric() {}
CheckedNumeric() = default;
// Copy constructor.
template <typename Src>
......
......@@ -27,7 +27,7 @@ class TimezoneCache {
virtual void Clear() = 0;
// Called when tearing down the isolate
virtual ~TimezoneCache() {}
virtual ~TimezoneCache() = default;
};
} // namespace base
......
......@@ -44,7 +44,7 @@ class FunctionalTest : public ::testing::Test {
public:
FunctionalTest()
: rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {}
virtual ~FunctionalTest() {}
virtual ~FunctionalTest() = default;
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