diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-07-08 20:22:55 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-07-08 20:29:00 +0200 |
commit | 345f42a9e3ae3bd0ccf979422f7f4dca9be1cb57 (patch) | |
tree | 49f38101001df067ea4b88a22681e71fa37c2397 /src | |
parent | 0a6ee9797e65335eeacfc0c2f27de3a998e06c82 (diff) | |
parent | c4606b84329d760d7cee144bebe05807857edaae (diff) |
Merge #14505: test: Add linter to make sure single parameter constructors are marked explicit
c4606b84329d760d7cee144bebe05807857edaae Add Travis check for single parameter constructors not marked "explicit" (practicalswift)
Pull request description:
Make single parameter constructors `explicit` (C++11).
Rationale from the developer notes:
> - By default, declare single-argument constructors `explicit`.
> - *Rationale*: This is a precaution to avoid unintended conversions that might
> arise when single-argument constructors are used as implicit conversion
> functions.
ACKs for top commit:
laanwj:
ACK c4606b84329d760d7cee144bebe05807857edaae
Tree-SHA512: 3e6fd51935fd93b2604b2188664692973d0897469f814cd745b5147d71b99ea5d73c1081cfde9f6393f51f56969e412fcda35d2d54e938a3235b8d40945f31fd
Diffstat (limited to 'src')
-rw-r--r-- | src/index/blockfilterindex.cpp | 4 | ||||
-rw-r--r-- | src/interfaces/chain.cpp | 2 | ||||
-rw-r--r-- | src/rpc/util.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp index 20f33baf2c..c3ce8d7af0 100644 --- a/src/index/blockfilterindex.cpp +++ b/src/index/blockfilterindex.cpp @@ -53,7 +53,7 @@ struct DBHeightKey { int height; DBHeightKey() : height(0) {} - DBHeightKey(int height_in) : height(height_in) {} + explicit DBHeightKey(int height_in) : height(height_in) {} template<typename Stream> void Serialize(Stream& s) const @@ -76,7 +76,7 @@ struct DBHeightKey { struct DBHashKey { uint256 hash; - DBHashKey(const uint256& hash_in) : hash(hash_in) {} + explicit DBHashKey(const uint256& hash_in) : hash(hash_in) {} ADD_SERIALIZE_METHODS; diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 161dd01ffe..02f39cef8e 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -205,7 +205,7 @@ public: class RpcHandlerImpl : public Handler { public: - RpcHandlerImpl(const CRPCCommand& command) : m_command(command), m_wrapped_command(&command) + explicit RpcHandlerImpl(const CRPCCommand& command) : m_command(command), m_wrapped_command(&command) { m_command.actor = [this](const JSONRPCRequest& request, UniValue& result, bool last_handler) { if (!m_wrapped_command) return false; diff --git a/src/rpc/util.h b/src/rpc/util.h index 8762281d73..ae3c3d63e0 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -226,7 +226,7 @@ struct RPCResults { struct RPCExamples { const std::string m_examples; - RPCExamples( + explicit RPCExamples( std::string examples) : m_examples(std::move(examples)) { |