From 6cb5078cb21c8c10d4233ab9f1829f97c62b2c9f Mon Sep 17 00:00:00 2001 From: Ben RUBSON Date: Thu, 2 Nov 2017 08:28:22 +0100 Subject: [PATCH] Correct explicit-constructor clang warning --- encfs/XmlReader.cpp | 2 +- encfs/autosprintf.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/encfs/XmlReader.cpp b/encfs/XmlReader.cpp index b28c264..18d0cef 100644 --- a/encfs/XmlReader.cpp +++ b/encfs/XmlReader.cpp @@ -154,7 +154,7 @@ class XmlNode : virtual public XmlValue { const tinyxml2::XMLElement *element; public: - XmlNode(const tinyxml2::XMLElement *element_) + explicit XmlNode(const tinyxml2::XMLElement *element_) : XmlValue(safeValueForNode(element_)), element(element_) {} ~XmlNode() override = default; diff --git a/encfs/autosprintf.h b/encfs/autosprintf.h index 9303168..cf91dbd 100644 --- a/encfs/autosprintf.h +++ b/encfs/autosprintf.h @@ -48,8 +48,8 @@ class autosprintf { /* Destructor: frees the temporarily allocated string. */ ~autosprintf(); /* Conversion to string. */ - operator char*() const; - operator std::string() const; + explicit operator char*() const; + explicit operator std::string() const; /* Output to an ostream. */ friend inline std::ostream& operator<<(std::ostream& stream, const autosprintf& tmp) {