From e2fc3a9c9cb8188c841a07ee59c01d1b2afd8622 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 30 Oct 2019 17:20:46 -0400 Subject: Googletest export Tolerate std::string's explicit copy construction from std::string_view. PiperOrigin-RevId: 277583394 --- googlemock/include/gmock/gmock-matchers.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'googlemock/include') diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index a9648835..b8ec24dd 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -758,8 +758,7 @@ class HasSubstrMatcher { template bool MatchAndExplain(const MatcheeStringType& s, MatchResultListener* /* listener */) const { - const StringType& s2(s); - return s2.find(substring_) != StringType::npos; + return StringType(s).find(substring_) != StringType::npos; } // Describes what this matcher matches. -- cgit v1.2.3