From d86a723ed95229f7412e72daafd2c0a89c705830 Mon Sep 17 00:00:00 2001 From: kosak Date: Mon, 13 Jul 2015 21:19:43 +0000 Subject: [PATCH] Mark the default constructor of Matcher<> explicit. This prevents implicitly constructing a matcher from {}. --- include/gmock/gmock-matchers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h index 58fe3b63..67cbe0fb 100644 --- a/include/gmock/gmock-matchers.h +++ b/include/gmock/gmock-matchers.h @@ -321,7 +321,7 @@ class Matcher : public internal::MatcherBase { // Constructs a null matcher. Needed for storing Matcher objects in STL // containers. A default-constructed matcher is not yet initialized. You // cannot use it until a valid value has been assigned to it. - Matcher() {} + explicit Matcher() {} // NOLINT // Constructs a matcher from its implementation. explicit Matcher(const MatcherInterface* impl)