aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-01-17 13:53:01 -0500
committerXiaoyi Zhang <zhangxy@google.com>2020-01-21 16:26:33 -0500
commitd01e356e155a84b196cf17435b7ebea35ccf9668 (patch)
treebcea1a309801b75ec7d3c0bea556e6c8953e376d /googlemock
parent9417fb401a578b32656f7c4d05a0e6a18940b825 (diff)
downloadgoogletest-d01e356e155a84b196cf17435b7ebea35ccf9668.tar.gz
googletest-d01e356e155a84b196cf17435b7ebea35ccf9668.tar.bz2
googletest-d01e356e155a84b196cf17435b7ebea35ccf9668.zip
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
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 67bd7e27..4baeb1bd 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -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;