From: Abseil Team Date: Fri, 17 Jan 2020 18:53:01 +0000 (-0500) Subject: Googletest export X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d01e356e155a84b196cf17435b7ebea35ccf9668;p=googletest.git Googletest export Allow copying of the string in MatchAndExplain. Otherwise, conversions from std::string_view to std::string will fail as being explicit PiperOrigin-RevId: 290301103 --- diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 67bd7e2..4baeb1b 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -678,7 +678,7 @@ class StrEqualityMatcher { template bool MatchAndExplain(const MatcheeStringType& s, MatchResultListener* /* listener */) const { - const StringType& s2(s); + const StringType s2(s); const bool eq = case_sensitive_ ? s2 == string_ : CaseInsensitiveStringEquals(s2, string_); return expect_eq_ == eq;