Mark single argument constructors in mutex.h as explicit.
authorDan Minor <dminor@mozilla.com>
Tue, 28 Mar 2017 20:04:41 +0000 (16:04 -0400)
committerAndreas Schuh <andreas.schuh.84@gmail.com>
Wed, 29 Mar 2017 12:01:34 +0000 (13:01 +0100)
src/mutex.h

index 1648c2f..7d7c364 100644 (file)
@@ -166,7 +166,7 @@ class Mutex {
   // It inhibits work being done by the destructor, which makes it
   // safer for code that tries to acqiure this mutex in their global
   // destructor.
-  inline Mutex(LinkerInitialized);
+  explicit inline Mutex(LinkerInitialized);
 
   // Destructor
   inline ~Mutex();
@@ -197,7 +197,7 @@ class Mutex {
   inline void SetIsSafe() { is_safe_ = true; }
 
   // Catch the error of writing Mutex when intending MutexLock.
-  Mutex(Mutex* /*ignored*/) {}
+  explicit Mutex(Mutex* /*ignored*/) {}
   // Disallow "evil" constructors
   Mutex(const Mutex&);
   void operator=(const Mutex&);