aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-matchers.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-02-03 11:16:38 -0500
committerAndy Getz <durandal@google.com>2020-02-07 13:35:00 -0500
commit4f6609129a2ffe83308406655f770352cbbfd6b6 (patch)
treed9041a3f38b2cc9b36771d5fde882d93f78a6493 /googlemock/include/gmock/gmock-matchers.h
parent74b44b2d0fc201f4b6afdac37e9a32f4352a3dee (diff)
downloadgoogletest-4f6609129a2ffe83308406655f770352cbbfd6b6.tar.gz
googletest-4f6609129a2ffe83308406655f770352cbbfd6b6.tar.bz2
googletest-4f6609129a2ffe83308406655f770352cbbfd6b6.zip
Googletest export
Fix std::move to std::forward where appropriate to support reference types. PiperOrigin-RevId: 292923058
Diffstat (limited to 'googlemock/include/gmock/gmock-matchers.h')
-rw-r--r--googlemock/include/gmock/gmock-matchers.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 473b3aa8..7d136af9 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -470,10 +470,12 @@ class MatcherBaseImpl<Derived<Ts...>> {
// conversions.
template <typename E = std::enable_if<sizeof...(Ts) == 1>,
typename E::type* = nullptr>
- explicit MatcherBaseImpl(Ts... params) : params_(std::move(params)...) {}
+ explicit MatcherBaseImpl(Ts... params)
+ : params_(std::forward<Ts>(params)...) {}
template <typename E = std::enable_if<sizeof...(Ts) != 1>,
typename = typename E::type>
- MatcherBaseImpl(Ts... params) : params_(std::move(params)...) {} // NOLINT
+ MatcherBaseImpl(Ts... params) // NOLINT
+ : params_(std::forward<Ts>(params)...) {}
template <typename F>
operator ::testing::Matcher<F>() const { // NOLINT(runtime/explicit)