From 1cf11317cac2c11d20b2324d4283814f1351c1a3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 21 Aug 2020 04:00:55 +0100 Subject: refactor(tvix/libutil): Mark single-argument constructors explicit This is the clang-tidy lint 'google-explicit-constructor'. There's a whole bunch of breakage that was introduced by this, and we had to opt out a few types of this (esp. the string formatting crap). In some cases minor other changes have been done to keep the code working, instead of converting between types (e.g. an explicit comparison operator implementation for nix::Pid). Change-Id: I12e1ca51a6bc2c882dba81a2526b9729d26988e7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1832 Tested-by: BuildkiteCI Reviewed-by: kanepyork Reviewed-by: glittershark --- third_party/nix/src/libutil/config.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libutil/config.hh') diff --git a/third_party/nix/src/libutil/config.hh b/third_party/nix/src/libutil/config.hh index 027a6be2982a..81b1c80e0e97 100644 --- a/third_party/nix/src/libutil/config.hh +++ b/third_party/nix/src/libutil/config.hh @@ -16,7 +16,8 @@ class AbstractConfig { protected: StringMap unknownSettings; - AbstractConfig(const StringMap& initials = {}) : unknownSettings(initials) {} + explicit AbstractConfig(const StringMap& initials = {}) + : unknownSettings(initials) {} public: virtual bool set(const std::string& name, const std::string& value) = 0; @@ -74,7 +75,7 @@ class Config : public AbstractConfig { Settings _settings; public: - Config(const StringMap& initials = {}) : AbstractConfig(initials) {} + explicit Config(const StringMap& initials = {}) : AbstractConfig(initials) {} bool set(const std::string& name, const std::string& value) override; @@ -218,7 +219,7 @@ struct GlobalConfig : public AbstractConfig { void convertToArgs(Args& args, const std::string& category) override; struct Register { - Register(Config* config); + explicit Register(Config* config); }; }; -- cgit 1.4.1