aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-10-30 17:20:46 -0400
committervslashg <gfalcon@google.com>2019-10-31 15:11:31 -0400
commite2fc3a9c9cb8188c841a07ee59c01d1b2afd8622 (patch)
treef88f0e069d7cd2c4a904285898161a2c6b21f7a8 /googlemock
parent0a03480824b4fc7883255dbd2fd8940c9f81e22e (diff)
downloadgoogletest-e2fc3a9c9cb8188c841a07ee59c01d1b2afd8622.tar.gz
googletest-e2fc3a9c9cb8188c841a07ee59c01d1b2afd8622.tar.bz2
googletest-e2fc3a9c9cb8188c841a07ee59c01d1b2afd8622.zip
Googletest export
Tolerate std::string's explicit copy construction from std::string_view. PiperOrigin-RevId: 277583394
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h3
1 files changed, 1 insertions, 2 deletions
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 <typename MatcheeStringType>
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.