Skip to content

Commit

Permalink
#2264: fix non-virtual-dtor and suggest-override warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs authored and cwschilly committed Sep 20, 2024
1 parent 59b59e9 commit 93aac5f
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/vt/group/base/group_info_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ struct InfoBase {
using TreeType = collective::tree::Tree;
using TreePtrType = std::unique_ptr<TreeType>;

virtual ~InfoBase() = default;

protected:
virtual GroupType getGroupID() const = 0;
virtual ActionType getAction() const = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/vt/group/collective/group_info_collective.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ struct InfoColl : virtual InfoBase {
{
}

virtual ~InfoColl() = default;

private:
/*
* Inner struct used as functor reduce target after the collective group is
Expand Down
1 change: 1 addition & 0 deletions src/vt/group/rooted/group_info_rooted.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct InfoRooted : virtual InfoBase {
bool const& in_is_remote, RegionPtrType in_region,
RegionType::SizeType const& in_total_size
);
virtual ~InfoRooted() = default;

protected:
void setupRooted();
Expand Down
2 changes: 1 addition & 1 deletion src/vt/messaging/message/smart_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct MsgPtrImplBase {

template <typename MsgT>
struct MsgPtrImplTyped : MsgPtrImplBase {
virtual void messageDeref(std::byte* msg_ptr) {
virtual void messageDeref(std::byte* msg_ptr) override {
// N.B. messageDeref<T> invokes delete-expr T.
vt::messageDeref(reinterpret_cast<MsgT*>(msg_ptr));
}
Expand Down
2 changes: 1 addition & 1 deletion src/vt/objgroup/holder/holder_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ template <typename ObjT>
struct HolderObjBase : HolderBase {
virtual ~HolderObjBase() = default;
virtual ObjT* get() = 0;
virtual std::byte* getPtr() = 0;
virtual std::byte* getPtr() override = 0;
};

}}} /* end namespace vt::objgroup::holder */
Expand Down
1 change: 1 addition & 0 deletions src/vt/runtime/component/component_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace vt { namespace runtime { namespace component {
* unique name for the given component.
*/
struct ComponentName {
virtual ~ComponentName() = default;
/**
* \internal \brief Get the name of the component
*/
Expand Down
2 changes: 2 additions & 0 deletions src/vt/runtime/component/diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ struct Diagnostic : ComponentName, ComponentReducer {
using UpdateType = DiagnosticUpdate;
using UnitType = DiagnosticUnit;

virtual ~Diagnostic() = default;

virtual void dumpState() = 0;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/vt/runtime/component/progressable.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace vt { namespace runtime { namespace component {
*/
struct Progressable {

virtual ~Progressable() = default;

/**
* \brief Progress function for incremental polling
*
Expand Down
1 change: 1 addition & 0 deletions src/vt/termination/term_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct TermAction : TermTerminated {
using EpochStateType = std::unordered_map<EpochType,TermStateType>;

TermAction() = default;
virtual ~TermAction() = default;

public:
void addDefaultAction(ActionType action);
Expand Down
2 changes: 2 additions & 0 deletions src/vt/termination/term_terminated.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ enum struct TermStatusEnum : int8_t {
};

struct TermTerminated {
virtual ~TermTerminated() = default;

virtual TermStatusEnum testEpochTerminated(EpochType epoch) = 0;
};

Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/holders/base_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace vt { namespace vrt { namespace collection {

struct BaseHolder {
BaseHolder() = default;
virtual ~BaseHolder() = default;

virtual void destroy() = 0;
};
Expand Down
3 changes: 3 additions & 0 deletions src/vt/vrt/collection/types/has_migrate.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
//@HEADER
*/

#include "vt/vrt/context/context_vrtmanager.impl.h"
#if !defined INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H
#define INCLUDED_VT_VRT_COLLECTION_TYPES_HAS_MIGRATE_H

Expand All @@ -49,6 +50,8 @@
namespace vt { namespace vrt { namespace collection {

struct HasMigrate {
virtual ~HasMigrate() = default;

virtual void migrate(NodeType const& to_node) = 0;
};

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/active/test_active_bcast_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ struct TestActiveBroadcastPut : TestParameterHarnessNode {
static int num_msg_sent;
static size_t put_size;

virtual void SetUp() {
virtual void SetUp() override {
TestParameterHarnessNode::SetUp();
handler_count = 0;
num_msg_sent = 1;

SET_MIN_NUM_NODES_CONSTRAINT(2);
}

virtual void TearDown() {
virtual void TearDown() override {
TestParameterHarnessNode::TearDown();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/active/test_active_broadcast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct TestActiveBroadcast : TestParameterHarnessNode {
static int handler_count;
static int num_msg_sent;

virtual void SetUp() {
virtual void SetUp() override {
TestParameterHarnessNode::SetUp();

handler_count = 0;
Expand All @@ -68,7 +68,7 @@ struct TestActiveBroadcast : TestParameterHarnessNode {
SET_MIN_NUM_NODES_CONSTRAINT(2);
}

virtual void TearDown() {
virtual void TearDown() override {
TestParameterHarnessNode::TearDown();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/active/test_active_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct TestActiveSend : TestParallelHarness {
static int handler_count;
static int num_msg_sent;

virtual void SetUp() {
virtual void SetUp() override {
TestParallelHarness::SetUp();

handler_count = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/active/test_active_send_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct TestActiveSendPut : TestParameterHarnessNode {
static NodeType from_node;
static NodeType to_node;

virtual void SetUp() {
virtual void SetUp() override {
TestParameterHarnessNode::SetUp();
from_node = 0;
to_node = 1;
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/collection/test_lb_data_retention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct TestCol : vt::Collection<TestCol,vt::Index1D> {
static constexpr int32_t const num_elms = 16;

struct TestLBDataRetention : TestParallelHarness {
virtual void SetUp() {
virtual void SetUp() override {
TestParallelHarness::SetUp();

// We must have more or equal number of elements than nodes for this test to
Expand All @@ -116,7 +116,6 @@ struct TestLBDataRetention : TestParallelHarness {
}
};

using vt::vrt::collection::balance::LoadModel;
using vt::vrt::collection::balance::PersistenceMedianLastN;

TEST_F(TestLBDataRetention, test_lbdata_retention_last1) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/index/test_index.nompi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
namespace vt { namespace tests { namespace unit {

class TestIndex : public TestHarness {
virtual void SetUp() {
virtual void SetUp() override {
TestHarness::SetUp();
}

virtual void TearDown() {
virtual void TearDown() override {
TestHarness::TearDown();
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/memory/test_memory_lifetime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ using NormalTestMsg = TrackMsg;
using SerialTestMsg = SerialTrackMsg;

struct TestMemoryLifetime : TestParallelHarness {
virtual void SetUp() {
virtual void SetUp() override {
TestParallelHarness::SetUp();
SerialTestMsg::alloc_count = 0;
local_count = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pool/test_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct TestPool : TestParallelHarness {
template <int64_t num_bytes>
static void testPoolFun(TestMsg<num_bytes>* prev_msg);

virtual void SetUp() {
virtual void SetUp() override {
TestParallelHarness::SetUp();
}
};
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pool/test_pool_message_sizes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static constexpr NodeType const to_node = 1;
struct TestPoolMessageSizes : TestParallelHarness {
static int count;

virtual void SetUp() {
virtual void SetUp() override {
TestParallelHarness::SetUp();
count = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_parallel_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern char** test_argv;

template <typename TestBase>
struct TestParallelHarnessAny : TestHarnessAny<TestBase> {
virtual void SetUp() {
virtual void SetUp() override {
using namespace vt;

TestHarnessAny<TestBase>::SetUp();
Expand Down Expand Up @@ -102,7 +102,7 @@ struct TestParallelHarnessAny : TestHarnessAny<TestBase> {
#endif
}

virtual void TearDown() {
virtual void TearDown() override {
using namespace vt;

try {
Expand Down

0 comments on commit 93aac5f

Please sign in to comment.