Skip to content

Commit 6916024

Browse files
author
MarcoFalke
committed
Merge #13282: trivial: Mark overrides as such.
60ebc7d trivial: Mark overrides as such. (Daniel Kraft) Pull request description: This trivial change adds the `override` keyword to some methods that override virtual base class / interface methods. This ensures that any future changes to the interface's method signatures which are not correctly mirrored in the subclasses will break at compile time with a clear error message, rather than at runtime. Tree-SHA512: cc1bfa5f03b5e29d20e3eab07b0b5fa2f77b47f79e08263dbff43e4f463e9dd8f4f537e2c8c9b6cb3663220dcf40cfd77723cd9fcbd623c9efc90a4cd44facfc
2 parents d82c5d1 + 60ebc7d commit 6916024

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/bench/bench.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,19 @@ class Printer
111111
class ConsolePrinter : public Printer
112112
{
113113
public:
114-
void header();
115-
void result(const State& state);
116-
void footer();
114+
void header() override;
115+
void result(const State& state) override;
116+
void footer() override;
117117
};
118118

119119
// creates box plot with plotly.js
120120
class PlotlyPrinter : public Printer
121121
{
122122
public:
123123
PlotlyPrinter(std::string plotly_url, int64_t width, int64_t height);
124-
void header();
125-
void result(const State& state);
126-
void footer();
124+
void header() override;
125+
void result(const State& state) override;
126+
void footer() override;
127127

128128
private:
129129
std::string m_plotly_url;

src/test/validation_block_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ struct TestSubscriber : public CValidationInterface {
2525

2626
TestSubscriber(uint256 tip) : m_expected_tip(tip) {}
2727

28-
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
28+
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override
2929
{
3030
BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());
3131
}
3232

33-
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted)
33+
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted) override
3434
{
3535
BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock);
3636
BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash());
3737

3838
m_expected_tip = block->GetHash();
3939
}
4040

41-
void BlockDisconnected(const std::shared_ptr<const CBlock>& block)
41+
void BlockDisconnected(const std::shared_ptr<const CBlock>& block) override
4242
{
4343
BOOST_CHECK_EQUAL(m_expected_tip, block->GetHash());
4444

0 commit comments

Comments
 (0)