]> git-server-git.apps.pok.os.sepia.ceph.com Git - googletest.git/commitdiff
Googletest export
authorAbseil Team <absl-team@google.com>
Fri, 17 Jan 2020 18:53:01 +0000 (13:53 -0500)
committerXiaoyi Zhang <zhangxy@google.com>
Tue, 21 Jan 2020 21:26:33 +0000 (16:26 -0500)
Allow copying of the string in MatchAndExplain.

Otherwise, conversions from std::string_view to std::string will fail as being
explicit

PiperOrigin-RevId: 290301103

googlemock/include/gmock/gmock-matchers.h

index 67bd7e271323fd3778dea4dd805ef39f31548bf5..4baeb1bd0d84d4991328889894211dfa65f07ee6 100644 (file)
@@ -678,7 +678,7 @@ class StrEqualityMatcher {
   template <typename MatcheeStringType>
   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;