diff --git a/mfbt/WeakPtr.h b/mfbt/WeakPtr.h index ebcb9250674..58960ad6177 100644 --- a/mfbt/WeakPtr.h +++ b/mfbt/WeakPtr.h @@ -183,7 +183,7 @@ public: return *this = aOther->SelfReferencingWeakPtr(); } - WeakPtr(T* aOther) + MOZ_IMPLICIT WeakPtr(T* aOther) { *this = aOther; } diff --git a/mfbt/tests/TestPair.cpp b/mfbt/tests/TestPair.cpp index 37aa2c69410..940174df0f3 100644 --- a/mfbt/tests/TestPair.cpp +++ b/mfbt/tests/TestPair.cpp @@ -29,21 +29,21 @@ using mozilla::Pair; INSTANTIATE(int, int, prim1, 2 * sizeof(int)); INSTANTIATE(int, long, prim2, 2 * sizeof(long)); -struct EmptyClass { EmptyClass(int) {} }; -struct NonEmpty { char mC; NonEmpty(int) {} }; +struct EmptyClass { explicit EmptyClass(int) {} }; +struct NonEmpty { char mC; explicit NonEmpty(int) {} }; INSTANTIATE(int, EmptyClass, both1, sizeof(int)); INSTANTIATE(int, NonEmpty, both2, 2 * sizeof(int)); INSTANTIATE(EmptyClass, NonEmpty, both3, 1); -struct A { char dummy; A(int) {} }; -struct B : A { B(int aI) : A(aI) {} }; +struct A { char dummy; explicit A(int) {} }; +struct B : A { explicit B(int aI) : A(aI) {} }; INSTANTIATE(A, A, class1, 2); INSTANTIATE(A, B, class2, 2); INSTANTIATE(A, EmptyClass, class3, 1); -struct OtherEmpty : EmptyClass { OtherEmpty(int aI) : EmptyClass(aI) {} }; +struct OtherEmpty : EmptyClass { explicit OtherEmpty(int aI) : EmptyClass(aI) {} }; // C++11 requires distinct objects of the same type, within the same "most // derived object", to have different addresses. Pair allocates its elements as diff --git a/mfbt/tests/TestSplayTree.cpp b/mfbt/tests/TestSplayTree.cpp index b49371f3237..e1511e1abe0 100644 --- a/mfbt/tests/TestSplayTree.cpp +++ b/mfbt/tests/TestSplayTree.cpp @@ -89,7 +89,7 @@ static int gValues[] = { struct SplayInt : SplayTreeNode { - SplayInt(int aValue) : mValue(aValue) {} + explicit SplayInt(int aValue) : mValue(aValue) {} static int compare(const SplayInt& aOne, const SplayInt& aTwo) {