Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/google/protobuf/arena_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void TestCtorAndDtorTraits(std::vector<absl::string_view> def,
TraitsProber(Arena* arena, int) : Message(nullptr, nullptr) {
actions.push_back("(Arena, int)");
}
~TraitsProber() { actions.push_back("~()"); }
~TraitsProber() override { actions.push_back("~()"); }

TraitsProber* New(Arena*) const {
ABSL_LOG(FATAL);
Expand Down Expand Up @@ -2500,7 +2500,7 @@ TEST(ArenaPtrTest, ClassIsABIEfficient) {
// using clang.
#if ABSL_HAVE_BUILTIN(__is_trivially_relocatable)
struct ABSL_ATTRIBUTE_TRIVIAL_ABI Probe {
~Probe() {}
~Probe() = default;
std::unique_ptr<int> p1;
void* p2;
};
Expand Down
8 changes: 4 additions & 4 deletions src/google/protobuf/descriptor_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ bool DescriptorDatabase::FindAllMessageNames(

// ===================================================================

SimpleDescriptorDatabase::SimpleDescriptorDatabase() {}
SimpleDescriptorDatabase::~SimpleDescriptorDatabase() {}
SimpleDescriptorDatabase::SimpleDescriptorDatabase() = default;
SimpleDescriptorDatabase::~SimpleDescriptorDatabase() = default;

template <typename Value>
bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile(
Expand Down Expand Up @@ -934,7 +934,7 @@ EncodedDescriptorDatabase::~EncodedDescriptorDatabase() {
DescriptorPoolDatabase::DescriptorPoolDatabase(
const DescriptorPool& pool, DescriptorPoolDatabaseOptions options)
: pool_(pool), options_(std::move(options)) {}
DescriptorPoolDatabase::~DescriptorPoolDatabase() {}
DescriptorPoolDatabase::~DescriptorPoolDatabase() = default;

bool DescriptorPoolDatabase::FindFileByName(
absl::string_view filename, FileDescriptorProto* PROTOBUF_NONNULL output) {
Expand Down Expand Up @@ -1005,7 +1005,7 @@ MergedDescriptorDatabase::MergedDescriptorDatabase(
MergedDescriptorDatabase::MergedDescriptorDatabase(
const std::vector<DescriptorDatabase*>& sources)
: sources_(sources) {}
MergedDescriptorDatabase::~MergedDescriptorDatabase() {}
MergedDescriptorDatabase::~MergedDescriptorDatabase() = default;

bool MergedDescriptorDatabase::FindFileByName(
absl::string_view filename, FileDescriptorProto* PROTOBUF_NONNULL output) {
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/descriptor_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PROTOBUF_EXPORT DescriptorDatabase {
using StringViewArg ABSL_DEPRECATE_AND_INLINE() = absl::string_view;

public:
inline DescriptorDatabase() {}
inline DescriptorDatabase() = default;
DescriptorDatabase(const DescriptorDatabase&) = delete;
DescriptorDatabase& operator=(const DescriptorDatabase&) = delete;
virtual ~DescriptorDatabase();
Expand Down
8 changes: 4 additions & 4 deletions src/google/protobuf/descriptor_database_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void ExpectContainsType(const FileDescriptorProto& proto,
// implementations for each of the three classes we want to test.
class DescriptorDatabaseTestCase {
public:
virtual ~DescriptorDatabaseTestCase() {}
virtual ~DescriptorDatabaseTestCase() = default;

virtual DescriptorDatabase* GetDatabase() = 0;
virtual bool AddToDatabase(const FileDescriptorProto& file) = 0;
Expand All @@ -76,7 +76,7 @@ class SimpleDescriptorDatabaseTestCase : public DescriptorDatabaseTestCase {
return new SimpleDescriptorDatabaseTestCase;
}

~SimpleDescriptorDatabaseTestCase() override {}
~SimpleDescriptorDatabaseTestCase() override = default;

DescriptorDatabase* GetDatabase() override { return &database_; }
bool AddToDatabase(const FileDescriptorProto& file) override {
Expand All @@ -94,7 +94,7 @@ class EncodedDescriptorDatabaseTestCase : public DescriptorDatabaseTestCase {
return new EncodedDescriptorDatabaseTestCase;
}

~EncodedDescriptorDatabaseTestCase() override {}
~EncodedDescriptorDatabaseTestCase() override = default;

DescriptorDatabase* GetDatabase() override { return &database_; }
bool AddToDatabase(const FileDescriptorProto& file) override {
Expand All @@ -115,7 +115,7 @@ class DescriptorPoolDatabaseTestCase : public DescriptorDatabaseTestCase {
}

DescriptorPoolDatabaseTestCase() : database_(pool_) {}
~DescriptorPoolDatabaseTestCase() override {}
~DescriptorPoolDatabaseTestCase() override = default;

DescriptorDatabase* GetDatabase() override { return &database_; }
bool AddToDatabase(const FileDescriptorProto& file) override {
Expand Down
4 changes: 3 additions & 1 deletion src/google/protobuf/lite_arena_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

#include <memory>

#include "absl/log/absl_check.h"
#include "google/protobuf/arena_test_util.h"
#include "google/protobuf/map_lite_unittest.pb.h"
Expand All @@ -23,7 +25,7 @@ class LiteArenaTest : public testing::Test {
ArenaOptions options;
options.start_block_size = 128 * 1024;
options.max_block_size = 128 * 1024;
arena_.reset(new Arena(options));
arena_ = std::make_unique<Arena>(options);
// Trigger the allocation of the first arena block, so that further use of
// the arena will not require any heap allocations.
(void)Arena::CreateArray<char>(arena_.get(), 1);
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/map_test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ class MyMapEntry
constexpr MyMapEntry()
: MyMapEntry::MapEntry(static_cast<ClassData*>(nullptr)) {}
MyMapEntry(Arena* arena) : MyMapEntry::MapEntry(arena, nullptr) {}
const ClassData* GetClassData() const {
const ClassData* GetClassData() const override {
ABSL_CHECK(false);
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/message_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ class PROTOBUF_EXPORT MessageLite {
explicit MessageLite(Arena* arena, const internal::ClassData* data)
: _internal_metadata_(arena), _class_data_(data) {}
#else // PROTOBUF_CUSTOM_VTABLE
constexpr MessageLite() {}
constexpr MessageLite() = default;
explicit MessageLite(Arena* arena) : _internal_metadata_(arena) {}
explicit constexpr MessageLite(const internal::ClassData*) {}
explicit MessageLite(Arena* arena, const internal::ClassData*)
Expand Down
6 changes: 3 additions & 3 deletions src/google/protobuf/service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace google {
namespace protobuf {

Service::~Service() {}
RpcChannel::~RpcChannel() {}
RpcController::~RpcController() {}
Service::~Service() = default;
RpcChannel::~RpcChannel() = default;
RpcController::~RpcController() = default;

} // namespace protobuf
} // namespace google
6 changes: 3 additions & 3 deletions src/google/protobuf/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Message; // message.h
// its exact type at compile time (analogous to Reflection).
class PROTOBUF_EXPORT Service {
public:
inline Service() {}
inline Service() = default;
Service(const Service&) = delete;
Service& operator=(const Service&) = delete;
virtual ~Service();
Expand Down Expand Up @@ -183,7 +183,7 @@ class PROTOBUF_EXPORT Service {
// advanced features (e.g. deadline propagation).
class PROTOBUF_EXPORT RpcController {
public:
inline RpcController() {}
inline RpcController() = default;
RpcController(const RpcController&) = delete;
RpcController& operator=(const RpcController&) = delete;
virtual ~RpcController();
Expand Down Expand Up @@ -248,7 +248,7 @@ class PROTOBUF_EXPORT RpcController {
// service->MyMethod(request, &response, callback);
class PROTOBUF_EXPORT RpcChannel {
public:
inline RpcChannel() {}
inline RpcChannel() = default;
RpcChannel(const RpcChannel&) = delete;
RpcChannel& operator=(const RpcChannel&) = delete;
virtual ~RpcChannel();
Expand Down
Loading