Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 9e0e190

Browse files
authored
Fix build errors related to unused lambda captures (#1175)
* Fix build errors related to unused lambda captures * Add missing virtual destructors Signed-off-by: Andrei Lebedev <[email protected]>
1 parent f3dc3bb commit 9e0e190

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

irohad/ametsuchi/impl/mutable_storage_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace iroha {
5555
function) {
5656
auto execute_transaction = [this](auto &transaction) {
5757
command_executor_->setCreatorAccountId(transaction->creatorAccountId());
58-
auto execute_command = [this, &transaction](auto command) {
58+
auto execute_command = [this](auto command) {
5959
auto result =
6060
boost::apply_visitor(*command_executor_, command->get());
6161
return result.match([](expected::Value<void> &v) { return true; },

irohad/ametsuchi/impl/postgres_block_query.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace iroha {
5151
shared_model::proto::from_old(block_old));
5252
};
5353
return rxcpp::observable<>::create<PostgresBlockQuery::wBlock>(
54-
[this, block{std::move(block)}](auto s) {
54+
[block{std::move(block)}](auto s) {
5555
if (block) {
5656
s.on_next(block);
5757
}
@@ -120,7 +120,7 @@ namespace iroha {
120120
*model::converters::stringToJson(bytesToString(bytes)))));
121121
};
122122
boost::for_each(
123-
result | boost::adaptors::transformed([&block](const auto &x) {
123+
result | boost::adaptors::transformed([](const auto &x) {
124124
return x.at("index").template as<size_t>();
125125
}),
126126
[&](auto x) {
@@ -198,7 +198,7 @@ namespace iroha {
198198
const shared_model::crypto::Hash &hash) {
199199
return getBlockId(hash) |
200200
[this](auto blockId) { return block_store_.get(blockId); } |
201-
[this](auto bytes) {
201+
[](auto bytes) {
202202
// TODO IR-975 victordrobny 12.02.2018 convert directly to
203203
// shared_model::proto::Block after FlatFile will be reworked to new
204204
// model

irohad/ametsuchi/ordering_service_persistent_state.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ namespace iroha {
4444
* Reset storage to default state
4545
*/
4646
virtual bool resetState() = 0;
47+
48+
virtual ~OrderingServicePersistentState() = default;
4749
};
4850
} // namespace ametsuchi
4951
} // namespace iroha

irohad/network/impl/block_loader_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ rxcpp::observable<std::shared_ptr<Block>> BlockLoaderImpl::retrieveBlocks(
8888
.build(block)
8989
.match(
9090
// success case
91-
[this, &context, &subscriber](
91+
[&subscriber](
9292
const iroha::expected::Value<shared_model::proto::Block>
9393
&result) {
9494
subscriber.on_next(

test/integration/acceptance/get_transactions_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ TEST_F(GetTransactions, HaveGetMyTx) {
169169
*/
170170
TEST_F(GetTransactions, InvalidSignatures) {
171171
auto dummy_tx = dummyTx();
172-
auto check = [&dummy_tx](auto &status) {
172+
auto check = [](auto &status) {
173173
auto resp = boost::get<shared_model::detail::PolymorphicWrapper<
174174
interface::ErrorQueryResponse>>(status.get());
175175
ASSERT_NO_THROW(boost::get<shared_model::detail::PolymorphicWrapper<

test/module/libs/common/result_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class Base {
166166
virtual int getNumber() {
167167
return 0;
168168
}
169+
virtual ~Base() = default;
169170
};
170171

171172
class Derived : public Base {

test/module/shared_model/cryptography/crypto_usage_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ class CryptoUsageTest : public ::testing::Test {
7070
and std::all_of(
7171
signable.signatures().begin(),
7272
signable.signatures().end(),
73-
[this,
74-
&signable](const shared_model::detail::PolymorphicWrapper<
73+
[&signable](const shared_model::detail::PolymorphicWrapper<
7574
shared_model::interface::Signature> &signature) {
7675
return shared_model::crypto::CryptoVerifier<>::verify(
7776
signature->signedData(),

0 commit comments

Comments
 (0)