Skip to content

Commit bb781f5

Browse files
committed
Bug#37471922: Auto-fix clang-tidy warnings [30/n] [noclose]
Generate fixes for a number of warnings that clang-tidy can fix automatically. This commit fixes the warning 'modernize-use-override'. Change example: - virtual ~Gcs_new_stage_1() override = default; + ~Gcs_new_stage_1() override = default; Change-Id: Id0d95f200991ab019eec43a014781cf40b103d47
1 parent 0ae3059 commit bb781f5

22 files changed

+59
-56
lines changed

storage/ndb/plugin/ha_ndbcluster_cond.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Ndb_end_cond : public Ndb_item {
144144

145145
public:
146146
Ndb_end_cond() = default;
147-
NDB_ITEM_TYPE get_type() const override final { return NDB_END_COND; }
147+
NDB_ITEM_TYPE get_type() const final { return NDB_END_COND; }
148148
};
149149

150150
class Ndb_func : public Ndb_item {
@@ -160,7 +160,7 @@ class Ndb_func : public Ndb_item {
160160
Ndb_func(Item_func::Functype func_type, uint no_args)
161161
: m_func_type(item_func_to_ndb_func(func_type)), m_arg_count(no_args) {}
162162

163-
NDB_ITEM_TYPE get_type() const override final { return NDB_FUNCTION; }
163+
NDB_ITEM_TYPE get_type() const final { return NDB_FUNCTION; }
164164

165165
NDB_FUNC_TYPE get_func_type() const { return m_func_type; }
166166

@@ -237,7 +237,7 @@ class Ndb_field : public Ndb_item {
237237
Ndb_field(Field *field, int column_no)
238238
: m_field(field), m_column_no(column_no) {}
239239

240-
NDB_ITEM_TYPE get_type() const override final { return NDB_FIELD; }
240+
NDB_ITEM_TYPE get_type() const final { return NDB_FIELD; }
241241

242242
Field *get_field() const { return m_field; }
243243

@@ -261,7 +261,7 @@ class Ndb_param : public Ndb_item {
261261
public:
262262
Ndb_param(const Item_field *item) : m_item(item), m_param_no(0) {}
263263

264-
NDB_ITEM_TYPE get_type() const override final { return NDB_PARAM; }
264+
NDB_ITEM_TYPE get_type() const final { return NDB_PARAM; }
265265

266266
void set_param_no(uint param_no) const { m_param_no = param_no; }
267267

storage/ndb/src/ndbapi/ndb_cluster_connection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ class NdbApiInternalLogHandler : public LogHandler {
433433
g_api_internal_log_handler = nullptr;
434434
}
435435

436-
virtual void append(const char *pCategory, Logger::LoggerLevel level,
437-
const char *pMsg, time_t now) override {
436+
void append(const char *pCategory, Logger::LoggerLevel level,
437+
const char *pMsg, time_t now) override {
438438
{
439439
if (m_userConsumer) {
440440
Guard g(m_consumer_mutex);

storage/ndb/test/include/SqlClient.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SqlResultSet : public Properties {
5252
SqlResultSet();
5353
SqlResultSet(SqlResultSet &) = delete;
5454
SqlResultSet(SqlResultSet &&) = delete;
55-
~SqlResultSet();
55+
~SqlResultSet() override;
5656

5757
const char *column(const char *col_name);
5858
std::string_view columnAsString(const char *col_name);

unittest/gunit/bgc_ticket_manager-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ using ticket_t = binlog::BgcTicket::ValueType;
7272
class Bgc_ticket_manager_test : public ::testing::Test {
7373
protected:
7474
Bgc_ticket_manager_test() = default;
75-
virtual void SetUp() {}
76-
virtual void TearDown() {}
75+
void SetUp() override {}
76+
void TearDown() override {}
7777
};
7878

7979
TEST_F(Bgc_ticket_manager_test, Several_tickets_test) {

unittest/gunit/containers/integrals_lockfree_queue-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ class Integrals_lockfree_queue_test : public ::testing::Test {
175175

176176
protected:
177177
Integrals_lockfree_queue_test() = default;
178-
virtual void SetUp() {}
179-
virtual void TearDown() {}
178+
void SetUp() override {}
179+
void TearDown() override {}
180180
};
181181

182182
TEST_F(Integrals_lockfree_queue_test, Padding_indexing_test) {

unittest/gunit/dd_pfs-t.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ class Dummy_object : public dd::Weak_object_impl_<with_pfs> {
5353
if (n_children > 0)
5454
for (auto &child : m_children) child = new Dummy_object<with_pfs, 0>();
5555
}
56-
~Dummy_object() {
56+
~Dummy_object() override {
5757
if (n_children > 0)
5858
for (auto &child : m_children) delete child;
5959
}
6060

6161
// Dummy definitions needed to make the class non-abstract.
62-
virtual void debug_print(dd::String_type &) const {}
63-
virtual const dd::Object_table &object_table() const {
62+
void debug_print(dd::String_type &) const override {}
63+
const dd::Object_table &object_table() const override {
6464
return dd::tables::Tables::instance();
6565
}
66-
virtual bool validate() const { return false; }
67-
virtual bool restore_attributes(const dd::Raw_record &) { return false; }
68-
virtual bool store_attributes(dd::Raw_record *) { return false; }
69-
virtual bool has_new_primary_key() const { return false; }
70-
virtual dd::Object_key *create_primary_key() const { return nullptr; }
66+
bool validate() const override { return false; }
67+
bool restore_attributes(const dd::Raw_record &) override { return false; }
68+
bool store_attributes(dd::Raw_record *) override { return false; }
69+
bool has_new_primary_key() const override { return false; }
70+
dd::Object_key *create_primary_key() const override { return nullptr; }
7171
};
7272

7373
/**

unittest/gunit/ddl_rewriter/ddl_rewriter-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace ddl_rewriter_unittest {
3434
class DDL_rewriter_test : public ::testing::Test {
3535
public:
3636
DDL_rewriter_test() = default;
37-
~DDL_rewriter_test() = default;
37+
~DDL_rewriter_test() override = default;
3838
};
3939

4040
struct Query_pair {

unittest/gunit/libmysqlgcs/xcom/gcs_logging-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Mock_Logger : public Logger_interface {
3232
ON_CALL(*this, finalize()).WillByDefault(Return(GCS_OK));
3333
}
3434

35-
~Mock_Logger() = default;
35+
~Mock_Logger() override = default;
3636
MOCK_METHOD0(initialize, enum_gcs_error());
3737
MOCK_METHOD0(finalize, enum_gcs_error());
3838
MOCK_METHOD2(log_event, void(const gcs_log_level_t, const std::string &));

unittest/gunit/libmysqlgcs/xcom/gcs_logging_system-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Wrapper_file_sink : public Sink_interface {
176176
.WillByDefault(Invoke(m_sink, &Gcs_file_sink::get_information));
177177
}
178178

179-
~Wrapper_file_sink() { delete m_sink; }
179+
~Wrapper_file_sink() override { delete m_sink; }
180180

181181
MOCK_METHOD1(log_event, void(const std::string &message));
182182
MOCK_METHOD2(log_event, void(const char *message, size_t message_size));

unittest/gunit/libmysqlgcs/xcom/gcs_message_stage_fragmentation-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Mock_gcs_xcom_proxy : public Gcs_xcom_proxy_base {
120120
/* Mocking fails compilation on Windows. It attempts to copy the std::future
121121
* which is non-copyable. */
122122
Gcs_xcom_input_queue::future_reply xcom_input_try_push_and_get_reply(
123-
app_data_ptr) {
123+
app_data_ptr) override {
124124
return std::future<std::unique_ptr<Gcs_xcom_input_queue::Reply>>();
125125
}
126126
MOCK_METHOD0(xcom_input_try_pop, xcom_input_request_ptr());

unittest/gunit/libmysqlgcs/xcom/gcs_msg_stages-t.cc

+9-9
Original file line numberDiff line numberDiff line change
@@ -433,18 +433,18 @@ TEST_F(XcomStagesTest, ReceivePacketWithUnknownStage) {
433433
*/
434434
class Gcs_new_stage_1 : public Gcs_message_stage {
435435
protected:
436-
virtual stage_status skip_apply(
436+
stage_status skip_apply(
437437
uint64_t const &original_payload_size) const override {
438438
bool result = (original_payload_size != 0);
439439
return result ? stage_status::apply : stage_status::abort;
440440
}
441441

442-
virtual stage_status skip_revert(const Gcs_packet &packet) const override {
442+
stage_status skip_revert(const Gcs_packet &packet) const override {
443443
bool result = (packet.get_payload_length() != 0);
444444
return result ? stage_status::apply : stage_status::abort;
445445
}
446446

447-
virtual std::pair<bool, std::vector<Gcs_packet>> apply_transformation(
447+
std::pair<bool, std::vector<Gcs_packet>> apply_transformation(
448448
Gcs_packet &&packet) override {
449449
int64_t id = htole64(get_id());
450450

@@ -470,8 +470,8 @@ class Gcs_new_stage_1 : public Gcs_message_stage {
470470
return std::make_pair(false, std::move(packets_out));
471471
}
472472

473-
virtual std::pair<Gcs_pipeline_incoming_result, Gcs_packet>
474-
revert_transformation(Gcs_packet &&packet) override {
473+
std::pair<Gcs_pipeline_incoming_result, Gcs_packet> revert_transformation(
474+
Gcs_packet &&packet) override {
475475
#ifndef NDEBUG
476476
auto const old_payload_length = packet.get_payload_length();
477477
#endif
@@ -509,9 +509,9 @@ class Gcs_new_stage_1 : public Gcs_message_stage {
509509
public:
510510
explicit Gcs_new_stage_1() : m_id(std::rand()) {}
511511

512-
virtual ~Gcs_new_stage_1() override = default;
512+
~Gcs_new_stage_1() override = default;
513513

514-
virtual Stage_code get_stage_code() const override { return my_stage_code(); }
514+
Stage_code get_stage_code() const override { return my_stage_code(); }
515515

516516
static Stage_code my_stage_code() { return static_cast<Stage_code>(10); }
517517

@@ -555,7 +555,7 @@ class Gcs_new_stage_split_4 : public Gcs_message_stage_split_v2 {
555555

556556
~Gcs_new_stage_split_4() override = default;
557557

558-
virtual Stage_code get_stage_code() const override { return my_stage_code(); }
558+
Stage_code get_stage_code() const override { return my_stage_code(); }
559559

560560
static Stage_code my_stage_code() { return static_cast<Stage_code>(13); }
561561
};
@@ -567,7 +567,7 @@ class Gcs_new_stage_lz4_5 : public Gcs_message_stage_lz4 {
567567

568568
~Gcs_new_stage_lz4_5() override = default;
569569

570-
virtual Stage_code get_stage_code() const override { return my_stage_code(); }
570+
Stage_code get_stage_code() const override { return my_stage_code(); }
571571

572572
static Stage_code my_stage_code() { return static_cast<Stage_code>(14); }
573573
};

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_communication_interface-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class mock_gcs_xcom_proxy : public Gcs_xcom_proxy_base {
149149
/* Mocking fails compilation on Windows. It attempts to copy the std::future
150150
* which is non-copyable. */
151151
Gcs_xcom_input_queue::future_reply xcom_input_try_push_and_get_reply(
152-
app_data_ptr) {
152+
app_data_ptr) override {
153153
return std::future<std::unique_ptr<Gcs_xcom_input_queue::Reply>>();
154154
}
155155
MOCK_METHOD0(xcom_input_try_pop, xcom_input_request_ptr());

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class mock_gcs_xcom_proxy : public Gcs_xcom_proxy_base {
427427
/* Mocking fails compilation on Windows. It attempts to copy the std::future
428428
* which is non-copyable. */
429429
Gcs_xcom_input_queue::future_reply xcom_input_try_push_and_get_reply(
430-
app_data_ptr) {
430+
app_data_ptr) override {
431431
return std::future<std::unique_ptr<Gcs_xcom_input_queue::Reply>>();
432432
}
433433
MOCK_METHOD0(xcom_input_try_pop, xcom_input_request_ptr());

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_network_provider-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class XComNetworkProviderTest : public GcsBaseTest {
3030
protected:
3131
XComNetworkProviderTest() {}
3232

33-
virtual void SetUp() {}
33+
void SetUp() override {}
3434

35-
virtual void TearDown() {}
35+
void TearDown() override {}
3636
};
3737

3838
TEST_F(XComNetworkProviderTest, StartAndStopTestMissingPort) {

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_network_provider_manager-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ class XComNetworkProviderManagerTest : public GcsBaseTest {
9898
protected:
9999
XComNetworkProviderManagerTest() {}
100100

101-
virtual void SetUp() {}
101+
void SetUp() override {}
102102

103-
virtual void TearDown() {}
103+
void TearDown() override {}
104104
};
105105

106106
TEST_F(XComNetworkProviderManagerTest, BasicManagerTest) {

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_state_exchange-t.cc

+10-7
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ class mock_gcs_xcom_communication_interface
7171
Cargo_type type));
7272
/* Mocking fails compilation on Windows. It attempts to copy the
7373
* std::unique_ptr which is non-copyable. */
74-
void buffer_incoming_packet(Gcs_packet &&packet,
75-
std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) {
74+
void buffer_incoming_packet(
75+
Gcs_packet &&packet,
76+
std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) override {
7677
buffer_incoming_packet_mock(packet, xcom_nodes);
7778
}
7879
MOCK_METHOD2(buffer_incoming_packet_mock,
@@ -91,7 +92,8 @@ class mock_gcs_xcom_communication_interface
9192
std::unique_ptr which is non-copyable.
9293
*/
9394
Gcs_message *convert_packet_to_message(
94-
Gcs_packet &&packet, std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) {
95+
Gcs_packet &&packet,
96+
std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) override {
9597
return convert_packet_to_message_mock(packet, xcom_nodes);
9698
}
9799
MOCK_METHOD2(convert_packet_to_message_mock,
@@ -101,8 +103,9 @@ class mock_gcs_xcom_communication_interface
101103
Mocking fails compilation on Windows. It attempts to copy the
102104
std::unique_ptr which is non-copyable.
103105
*/
104-
void process_user_data_packet(Gcs_packet &&packet,
105-
std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) {
106+
void process_user_data_packet(
107+
Gcs_packet &&packet,
108+
std::unique_ptr<Gcs_xcom_nodes> &&xcom_nodes) override {
106109
process_user_data_packet_mock(packet, xcom_nodes);
107110
}
108111
MOCK_METHOD2(process_user_data_packet_mock,
@@ -114,7 +117,7 @@ class mock_gcs_xcom_communication_interface
114117
which is non-copyable.
115118
*/
116119
std::pair<bool, std::future<void>> set_protocol_version(
117-
Gcs_protocol_version new_version) {
120+
Gcs_protocol_version new_version) override {
118121
auto future = std::async([this, new_version]() {
119122
return set_protocol_version_mock(new_version);
120123
});
@@ -135,7 +138,7 @@ class mock_gcs_xcom_communication_interface
135138
void(std::shared_ptr<Network_provider> provider));
136139
MOCK_METHOD0(get_incoming_connections_protocol, enum_transport_protocol());
137140

138-
virtual Gcs_message_pipeline &get_msg_pipeline() { return m_msg_pipeline; }
141+
Gcs_message_pipeline &get_msg_pipeline() override { return m_msg_pipeline; }
139142

140143
private:
141144
Gcs_message_pipeline m_msg_pipeline;

unittest/gunit/libmysqlgcs/xcom/gcs_xcom_xcom_base-t.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class XcomBase : public GcsBaseTest {
4949
auto xcom_network_provider = std::make_shared<Xcom_network_provider>();
5050
net_manager.add_network_provider(xcom_network_provider);
5151
}
52-
~XcomBase() { ::deinit_cache(); }
52+
~XcomBase() override { ::deinit_cache(); }
5353
};
5454

5555
TEST_F(XcomBase, XcomSendClientAppDataUpgradeScenario) {

unittest/gunit/locks/shared_spin_lock-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace unittests {
3636
class Shared_spin_lock_test : public ::testing::Test {
3737
protected:
3838
Shared_spin_lock_test() = default;
39-
virtual void SetUp() {}
40-
virtual void TearDown() {}
39+
void SetUp() override {}
40+
void TearDown() override {}
4141
};
4242

4343
TEST_F(Shared_spin_lock_test, Lock_unlock_test) {

unittest/gunit/memory/aligned_atomic-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ using Aligned_atomic_accessor_ut =
5050
class AlignedAtomicTest : public ::testing::Test {
5151
protected:
5252
AlignedAtomicTest() = default;
53-
virtual void SetUp() {}
54-
virtual void TearDown() {}
53+
void SetUp() override {}
54+
void TearDown() override {}
5555
};
5656

5757
TEST_F(AlignedAtomicTest, Class_template_test) {

unittest/gunit/memory/ref_ptr-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ namespace unittests {
3737
class Ref_ptr_test : public ::testing::Test {
3838
protected:
3939
Ref_ptr_test() = default;
40-
virtual void SetUp() {}
41-
virtual void TearDown() {}
40+
void SetUp() override {}
41+
void TearDown() override {}
4242
};
4343

4444
TEST_F(Ref_ptr_test, Class_template_test) {

unittest/gunit/memory/unique_ptr-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ namespace unittests {
3333
class Unique_ptr_test : public ::testing::Test {
3434
protected:
3535
Unique_ptr_test() = default;
36-
virtual void SetUp() {}
37-
virtual void TearDown() {}
36+
void SetUp() override {}
37+
void TearDown() override {}
3838
};
3939

4040
TEST_F(Unique_ptr_test, Array_template_test) {

unittest/gunit/rpl_commit_order_queue-t.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ namespace unittests {
3939
class Rpl_commit_order_queue_test : public ::testing::Test {
4040
protected:
4141
Rpl_commit_order_queue_test() = default;
42-
virtual void SetUp() {}
43-
virtual void TearDown() {}
42+
void SetUp() override {}
43+
void TearDown() override {}
4444

4545
std::atomic<bool> m_go{false};
4646
std::atomic<size_t> m_count{0};

0 commit comments

Comments
 (0)