From 29b47e45cfd0b30f8e7efd93e7ea34c8343012b3 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 16 Oct 2018 15:29:37 -0400 Subject: Googletest export C++11 code cleanup. PiperOrigin-RevId: 217364243 --- googlemock/include/gmock/gmock-actions.h | 11 +- googlemock/include/gmock/gmock-generated-actions.h | 315 ++++++++++----------- .../include/gmock/gmock-generated-actions.h.pump | 6 +- .../gmock/gmock-generated-function-mockers.h | 175 ++++++------ .../gmock/gmock-generated-function-mockers.h.pump | 6 +- .../include/gmock/gmock-generated-matchers.h | 181 +++++------- .../include/gmock/gmock-generated-matchers.h.pump | 5 +- googlemock/include/gmock/gmock-matchers.h | 16 +- googlemock/include/gmock/gmock-spec-builders.h | 39 ++- googletest/include/gtest/internal/gtest-port.h | 27 -- .../include/gtest/internal/gtest-type-util.h.pump | 2 +- 11 files changed, 342 insertions(+), 441 deletions(-) diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 8e7e0e7..d4af949 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -43,6 +43,7 @@ #include #include +#include #include "gmock/internal/gmock-internal-utils.h" #include "gmock/internal/gmock-port.h" @@ -527,7 +528,7 @@ class ActionAdaptor : public ActionInterface { // on return. Useful for move-only types, but could be used on any type. template struct ByMoveWrapper { - explicit ByMoveWrapper(T value) : payload(internal::move(value)) {} + explicit ByMoveWrapper(T value) : payload(std::move(value)) {} T payload; }; @@ -564,7 +565,7 @@ class ReturnAction { // Constructs a ReturnAction object from the value to be returned. // 'value' is passed by value instead of by const reference in order // to allow Return("string literal") to compile. - explicit ReturnAction(R value) : value_(new R(internal::move(value))) {} + explicit ReturnAction(R value) : value_(new R(std::move(value))) {} // This template type conversion operator allows Return(x) to be // used in ANY function that returns x's type. @@ -632,7 +633,7 @@ class ReturnAction { GTEST_CHECK_(!performed_) << "A ByMove() action should only be performed once."; performed_ = true; - return internal::move(wrapper_->payload); + return std::move(wrapper_->payload); } private: @@ -1116,7 +1117,7 @@ Action::Action(const Action& from) // will trigger a compiler error about using array as initializer. template internal::ReturnAction Return(R value) { - return internal::ReturnAction(internal::move(value)); + return internal::ReturnAction(std::move(value)); } // Creates an action that returns NULL. @@ -1149,7 +1150,7 @@ inline internal::ReturnRefOfCopyAction ReturnRefOfCopy(const R& x) { // invariant. template internal::ByMoveWrapper ByMove(R x) { - return internal::ByMoveWrapper(internal::move(x)); + return internal::ByMoveWrapper(std::move(x)); } // Creates an action that does the default action for the give mock function. diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h index 3ea14dd..0845b22 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h +++ b/googlemock/include/gmock/gmock-generated-actions.h @@ -41,6 +41,8 @@ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#include + #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" @@ -1161,90 +1163,67 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\ () #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\ - (p0##_type gmock_p0) : p0(::testing::internal::move(gmock_p0)) + (p0##_type gmock_p0) : p0(::std::move(gmock_p0)) #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\ - (p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) + (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)) #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\ (p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) + p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) + p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)) #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) + p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) + p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)) #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) + p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) + p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)) #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p7, p8)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) + p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p7, p8, p9)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) + p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \ + p9(::std::move(gmock_p9)) // Declares the fields for storing the value parameters. #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS() @@ -1481,7 +1460,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP {\ public:\ explicit name##ActionP(p0##_type gmock_p0) : \ - p0(::testing::internal::forward(gmock_p0)) {}\ + p0(::std::forward(gmock_p0)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1490,7 +1469,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function::ArgumentTuple\ args_type;\ explicit gmock_Impl(p0##_type gmock_p0) : \ - p0(::testing::internal::forward(gmock_p0)) {}\ + p0(::std::forward(gmock_p0)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1533,8 +1512,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP2 {\ public:\ name##ActionP2(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)) {}\ + p1##_type gmock_p1) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1543,8 +1522,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)) {}\ + p1##_type gmock_p1) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1590,9 +1569,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP3 {\ public:\ name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)) {}\ + p2##_type gmock_p2) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1601,9 +1580,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)) {}\ + p2##_type gmock_p2) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1654,10 +1633,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)) {}\ + p3##_type gmock_p3) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1666,10 +1645,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)) {}\ + p3##_type gmock_p3) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1726,11 +1705,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)) {}\ + p4##_type gmock_p4) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1740,11 +1719,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)) {}\ + p4##_type gmock_p4) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1803,12 +1782,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)) {}\ + p5##_type gmock_p5) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1818,12 +1797,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)) {}\ + p5##_type gmock_p5) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1886,13 +1865,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)) {}\ + p6##_type gmock_p6) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1902,13 +1881,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)) {}\ + p6##_type gmock_p6) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -1977,14 +1956,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)) {}\ + p7##_type gmock_p7) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -1995,14 +1974,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)) {}\ + p7##_type gmock_p7) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -2075,15 +2054,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)), \ - p8(::testing::internal::forward(gmock_p8)) {}\ + p8##_type gmock_p8) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -2094,15 +2073,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)), \ - p8(::testing::internal::forward(gmock_p8)) {}\ + p8##_type gmock_p8) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ @@ -2180,16 +2159,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)), \ - p8(::testing::internal::forward(gmock_p8)), \ - p9(::testing::internal::forward(gmock_p9)) {}\ + p9##_type gmock_p9) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)), \ + p9(::std::forward(gmock_p9)) {}\ template \ class gmock_Impl : public ::testing::ActionInterface {\ public:\ @@ -2200,16 +2179,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::forward(gmock_p0)), \ - p1(::testing::internal::forward(gmock_p1)), \ - p2(::testing::internal::forward(gmock_p2)), \ - p3(::testing::internal::forward(gmock_p3)), \ - p4(::testing::internal::forward(gmock_p4)), \ - p5(::testing::internal::forward(gmock_p5)), \ - p6(::testing::internal::forward(gmock_p6)), \ - p7(::testing::internal::forward(gmock_p7)), \ - p8(::testing::internal::forward(gmock_p8)), \ - p9(::testing::internal::forward(gmock_p9)) {}\ + p9##_type gmock_p9) : p0(::std::forward(gmock_p0)), \ + p1(::std::forward(gmock_p1)), \ + p2(::std::forward(gmock_p2)), \ + p3(::std::forward(gmock_p3)), \ + p4(::std::forward(gmock_p4)), \ + p5(::std::forward(gmock_p5)), \ + p6(::std::forward(gmock_p6)), \ + p7(::std::forward(gmock_p7)), \ + p8(::std::forward(gmock_p8)), \ + p9(::std::forward(gmock_p9)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper::\ Perform(this, args);\ diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump index 2794ebb..bc22be8 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h.pump +++ b/googlemock/include/gmock/gmock-generated-actions.h.pump @@ -43,6 +43,8 @@ $$}} This meta comment fixes auto-indentation in editors. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#include + #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" @@ -525,7 +527,7 @@ _VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]] $for i [[ $range j 0..i-1 #define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\ - ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::testing::internal::move(gmock_p$j))]] + ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::std::move(gmock_p$j))]] ]] @@ -658,7 +660,7 @@ $var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]] $range j 0..i-1 $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] -$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::forward(gmock_p$j))]]]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::forward(gmock_p$j))]]]]]] $var param_field_decls = [[$for j [[ diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h index 9886115..38a7d15 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h @@ -41,6 +41,8 @@ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#include + #include "gmock/gmock-spec-builders.h" #include "gmock/internal/gmock-internal-utils.h" @@ -98,7 +100,7 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1))); + return this->InvokeWith(ArgumentTuple(std::forward(a1))); } }; @@ -118,8 +120,8 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2))); } }; @@ -140,8 +142,8 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3))); } }; @@ -162,9 +164,8 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4))); } }; @@ -186,9 +187,9 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5))); } }; @@ -211,10 +212,9 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5), - internal::forward(a6))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5), std::forward(a6))); } }; @@ -237,10 +237,9 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5), - internal::forward(a6), internal::forward(a7))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5), std::forward(a6), std::forward(a7))); } }; @@ -263,11 +262,10 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5), - internal::forward(a6), internal::forward(a7), - internal::forward(a8))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5), std::forward(a6), std::forward(a7), + std::forward(a8))); } }; @@ -292,11 +290,10 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5), - internal::forward(a6), internal::forward(a7), - internal::forward(a8), internal::forward(a9))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5), std::forward(a6), std::forward(a7), + std::forward(a8), std::forward(a9))); } }; @@ -323,12 +320,10 @@ class FunctionMocker : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward(a1), - internal::forward(a2), internal::forward(a3), - internal::forward(a4), internal::forward(a5), - internal::forward(a6), internal::forward(a7), - internal::forward(a8), internal::forward(a9), - internal::forward(a10))); + return this->InvokeWith(ArgumentTuple(std::forward(a1), + std::forward(a2), std::forward(a3), std::forward(a4), + std::forward(a5), std::forward(a6), std::forward(a7), + std::forward(a8), std::forward(a9), std::forward(a10))); } }; @@ -451,7 +446,7 @@ using internal::FunctionMocker; this_method_does_not_take_1_argument); \ GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(1, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ @@ -479,9 +474,9 @@ using internal::FunctionMocker; this_method_does_not_take_2_arguments); \ GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(2, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2)); \ + ::std::forward(gmock_a2)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -511,10 +506,10 @@ using internal::FunctionMocker; this_method_does_not_take_3_arguments); \ GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(3, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -547,11 +542,11 @@ using internal::FunctionMocker; this_method_does_not_take_4_arguments); \ GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(4, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -587,12 +582,12 @@ using internal::FunctionMocker; this_method_does_not_take_5_arguments); \ GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(5, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -631,13 +626,13 @@ using internal::FunctionMocker; this_method_does_not_take_6_arguments); \ GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(6, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5), \ - ::testing::internal::forward(gmock_a6)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5), \ + ::std::forward(gmock_a6)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -678,14 +673,14 @@ using internal::FunctionMocker; this_method_does_not_take_7_arguments); \ GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(7, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5), \ - ::testing::internal::forward(gmock_a6), \ - ::testing::internal::forward(gmock_a7)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5), \ + ::std::forward(gmock_a6), \ + ::std::forward(gmock_a7)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -729,15 +724,15 @@ using internal::FunctionMocker; this_method_does_not_take_8_arguments); \ GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(8, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5), \ - ::testing::internal::forward(gmock_a6), \ - ::testing::internal::forward(gmock_a7), \ - ::testing::internal::forward(gmock_a8)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5), \ + ::std::forward(gmock_a6), \ + ::std::forward(gmock_a7), \ + ::std::forward(gmock_a8)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -784,16 +779,16 @@ using internal::FunctionMocker; this_method_does_not_take_9_arguments); \ GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(9, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5), \ - ::testing::internal::forward(gmock_a6), \ - ::testing::internal::forward(gmock_a7), \ - ::testing::internal::forward(gmock_a8), \ - ::testing::internal::forward(gmock_a9)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5), \ + ::std::forward(gmock_a6), \ + ::std::forward(gmock_a7), \ + ::std::forward(gmock_a8), \ + ::std::forward(gmock_a9)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ @@ -843,17 +838,17 @@ using internal::FunctionMocker; this_method_does_not_take_10_arguments); \ GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ return GMOCK_MOCKER_(10, constness, \ - Method).Invoke(::testing::internal::forward(gmock_a1), \ - ::testing::internal::forward(gmock_a2), \ - ::testing::internal::forward(gmock_a3), \ - ::testing::internal::forward(gmock_a4), \ - ::testing::internal::forward(gmock_a5), \ - ::testing::internal::forward(gmock_a6), \ - ::testing::internal::forward(gmock_a7), \ - ::testing::internal::forward(gmock_a8), \ - ::testing::internal::forward(gmock_a9), \ - ::testing::internal::forward(gmock_a10)); \ + ::std::forward(gmock_a2), \ + ::std::forward(gmock_a3), \ + ::std::forward(gmock_a4), \ + ::std::forward(gmock_a5), \ + ::std::forward(gmock_a6), \ + ::std::forward(gmock_a7), \ + ::std::forward(gmock_a8), \ + ::std::forward(gmock_a9), \ + ::std::forward(gmock_a10)); \ } \ ::testing::MockSpec<__VA_ARGS__> \ gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump index e05b18d..183e652 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump @@ -42,6 +42,8 @@ $var n = 10 $$ The maximum arity we support. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#include + #include "gmock/gmock-spec-builders.h" #include "gmock/internal/gmock-internal-utils.h" @@ -69,7 +71,7 @@ $for i [[ $range j 1..i $var typename_As = [[$for j [[, typename A$j]]]] $var As = [[$for j, [[A$j]]]] -$var as = [[$for j, [[internal::forward(a$j)]]]] +$var as = [[$for j, [[std::forward(a$j)]]]] $var Aas = [[$for j, [[A$j a$j]]]] $var ms = [[$for j, [[m$j]]]] $var matchers = [[$for j, [[const Matcher& m$j]]]] @@ -184,7 +186,7 @@ $for i [[ $range j 1..i $var arg_as = [[$for j, [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]] $var as = [[$for j, \ - [[::testing::internal::forward(gmock_a$j)]]]] + [[::std::forward(gmock_a$j)]]]] $var matcher_arg_as = [[$for j, \ [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]] $var matcher_as = [[$for j, [[gmock_a$j]]]] diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index 166122a..1161e87 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include "gmock/gmock-matchers.h" @@ -380,7 +381,6 @@ Args(const InnerMatcher& matcher) { } - } // namespace testing @@ -657,7 +657,7 @@ Args(const InnerMatcher& matcher) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ explicit gmock_Impl(p0##_type gmock_p0)\ - : p0(::testing::internal::move(gmock_p0)) {}\ + : p0(::std::move(gmock_p0)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -685,8 +685,7 @@ Args(const InnerMatcher& matcher) { return ::testing::Matcher(\ new gmock_Impl(p0));\ }\ - explicit name##MatcherP(p0##_type gmock_p0) : \ - p0(::testing::internal::move(gmock_p0)) {\ + explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\ }\ p0##_type const p0;\ private:\ @@ -711,8 +710,7 @@ Args(const InnerMatcher& matcher) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -742,8 +740,8 @@ Args(const InnerMatcher& matcher) { new gmock_Impl(p0, p1));\ }\ name##MatcherP2(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) {\ + p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -771,9 +769,8 @@ Args(const InnerMatcher& matcher) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -804,9 +801,8 @@ Args(const InnerMatcher& matcher) { new gmock_Impl(p0, p1, p2));\ }\ name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) {\ + p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -837,10 +833,8 @@ Args(const InnerMatcher& matcher) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -873,11 +867,9 @@ Args(const InnerMatcher& matcher) { new gmock_Impl(p0, p1, p2, p3));\ }\ name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) {\ + p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -913,11 +905,9 @@ Args(const InnerMatcher& matcher) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -952,11 +942,9 @@ Args(const InnerMatcher& matcher) { }\ name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) {\ + p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -993,12 +981,9 @@ Args(const InnerMatcher& matcher) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1034,12 +1019,10 @@ Args(const InnerMatcher& matcher) { }\ name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) {\ + p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1079,13 +1062,10 @@ Args(const InnerMatcher& matcher) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1123,14 +1103,10 @@ Args(const InnerMatcher& matcher) { }\ name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) {\ + p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1174,14 +1150,10 @@ Args(const InnerMatcher& matcher) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1221,14 +1193,11 @@ Args(const InnerMatcher& matcher) { name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) {\ + p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1275,15 +1244,11 @@ Args(const InnerMatcher& matcher) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1324,15 +1289,11 @@ Args(const InnerMatcher& matcher) { name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) {\ + p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1383,16 +1344,11 @@ Args(const InnerMatcher& matcher) { p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p9##_type gmock_p9)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1434,17 +1390,12 @@ Args(const InnerMatcher& matcher) { name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) {\ + p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \ + p9(::std::move(gmock_p9)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index 29b004d..dcb4243 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -45,6 +45,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs. #include #include #include +#include #include #include "gmock/gmock-matchers.h" @@ -442,8 +443,8 @@ $var template = [[$if i==0 [[]] $else [[ ]]]] $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] -$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] -$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] +$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] $var params = [[$for j, [[p$j]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index cdb7367..6e8bc03 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -1717,7 +1717,7 @@ class AllOfMatcherImpl : public MatcherInterface { public: explicit AllOfMatcherImpl(std::vector > matchers) - : matchers_(internal::move(matchers)) {} + : matchers_(std::move(matchers)) {} virtual void DescribeTo(::std::ostream* os) const { *os << "("; @@ -1791,7 +1791,7 @@ class VariadicMatcher { operator Matcher() const { std::vector > values; CreateVariadicMatcher(&values, std::integral_constant()); - return Matcher(new CombiningMatcher(internal::move(values))); + return Matcher(new CombiningMatcher(std::move(values))); } private: @@ -1824,7 +1824,7 @@ class AnyOfMatcherImpl : public MatcherInterface { public: explicit AnyOfMatcherImpl(std::vector > matchers) - : matchers_(internal::move(matchers)) {} + : matchers_(std::move(matchers)) {} virtual void DescribeTo(::std::ostream* os) const { *os << "("; @@ -1965,7 +1965,7 @@ class MatcherAsPredicate { template class PredicateFormatterFromMatcher { public: - explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {} + explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {} // This template () operator allows a PredicateFormatterFromMatcher // object to act as a predicate-formatter suitable for using with @@ -2009,7 +2009,7 @@ class PredicateFormatterFromMatcher { template inline PredicateFormatterFromMatcher MakePredicateFormatterFromMatcher(M matcher) { - return PredicateFormatterFromMatcher(internal::move(matcher)); + return PredicateFormatterFromMatcher(std::move(matcher)); } // Implements the polymorphic floating point equality matcher, which matches @@ -2569,7 +2569,7 @@ template class ResultOfMatcher { public: ResultOfMatcher(Callable callable, InnerMatcher matcher) - : callable_(internal::move(callable)), matcher_(internal::move(matcher)) { + : callable_(std::move(callable)), matcher_(std::move(matcher)) { CallableTraits::CheckIsValid(callable_); } @@ -4008,7 +4008,7 @@ template class VariantMatcher { public: explicit VariantMatcher(::testing::Matcher matcher) - : matcher_(internal::move(matcher)) {} + : matcher_(std::move(matcher)) {} template bool MatchAndExplain(const Variant& value, @@ -4504,7 +4504,7 @@ template internal::ResultOfMatcher ResultOf( Callable callable, InnerMatcher matcher) { return internal::ResultOfMatcher( - internal::move(callable), internal::move(matcher)); + std::move(callable), std::move(matcher)); } // String matchers. diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index b98e48b..849bc92 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -65,6 +65,7 @@ #include #include #include +#include #include #include "gmock/gmock-actions.h" #include "gmock/gmock-cardinalities.h" @@ -1320,13 +1321,13 @@ class ReferenceOrValueWrapper { public: // Constructs a wrapper from the given value/reference. explicit ReferenceOrValueWrapper(T value) - : value_(::testing::internal::move(value)) { + : value_(std::move(value)) { } // Unwraps and returns the underlying value/reference, exactly as // originally passed. The behavior of calling this more than once on // the same object is unspecified. - T Unwrap() { return ::testing::internal::move(value_); } + T Unwrap() { return std::move(value_); } // Provides nondestructive access to the underlying value/reference. // Always returns a const reference (more precisely, @@ -1401,27 +1402,26 @@ class ActionResultHolder : public UntypedActionResultHolderBase { template static ActionResultHolder* PerformDefaultAction( const FunctionMockerBase* func_mocker, - typename RvalueRef::ArgumentTuple>::type args, + typename Function::ArgumentTuple&& args, const std::string& call_description) { return new ActionResultHolder(Wrapper(func_mocker->PerformDefaultAction( - internal::move(args), call_description))); + std::move(args), call_description))); } // Performs the given action and returns the result in a new-ed // ActionResultHolder. template static ActionResultHolder* PerformAction( - const Action& action, - typename RvalueRef::ArgumentTuple>::type args) { + const Action& action, typename Function::ArgumentTuple&& args) { return new ActionResultHolder( - Wrapper(action.Perform(internal::move(args)))); + Wrapper(action.Perform(std::move(args)))); } private: typedef ReferenceOrValueWrapper Wrapper; explicit ActionResultHolder(Wrapper result) - : result_(::testing::internal::move(result)) { + : result_(std::move(result)) { } Wrapper result_; @@ -1442,9 +1442,9 @@ class ActionResultHolder : public UntypedActionResultHolderBase { template static ActionResultHolder* PerformDefaultAction( const FunctionMockerBase* func_mocker, - typename RvalueRef::ArgumentTuple>::type args, + typename Function::ArgumentTuple&& args, const std::string& call_description) { - func_mocker->PerformDefaultAction(internal::move(args), call_description); + func_mocker->PerformDefaultAction(std::move(args), call_description); return new ActionResultHolder; } @@ -1452,9 +1452,8 @@ class ActionResultHolder : public UntypedActionResultHolderBase { // ActionResultHolder*. template static ActionResultHolder* PerformAction( - const Action& action, - typename RvalueRef::ArgumentTuple>::type args) { - action.Perform(internal::move(args)); + const Action& action, typename Function::ArgumentTuple&& args) { + action.Perform(std::move(args)); return new ActionResultHolder; } @@ -1509,13 +1508,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // mutable state of this object, and thus can be called concurrently // without locking. // L = * - Result PerformDefaultAction( - typename RvalueRef::ArgumentTuple>::type args, - const std::string& call_description) const { + Result PerformDefaultAction(typename Function::ArgumentTuple&& args, + const std::string& call_description) const { const OnCallSpec* const spec = this->FindOnCallSpec(args); if (spec != nullptr) { - return spec->GetAction().Perform(internal::move(args)); + return spec->GetAction().Perform(std::move(args)); } const std::string message = call_description + @@ -1540,7 +1538,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { void* untyped_args, // must point to an ArgumentTuple const std::string& call_description) const { ArgumentTuple* args = static_cast(untyped_args); - return ResultHolder::PerformDefaultAction(this, internal::move(*args), + return ResultHolder::PerformDefaultAction(this, std::move(*args), call_description); } @@ -1554,7 +1552,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // action deletes the mock object (and thus deletes itself). const Action action = *static_cast*>(untyped_action); ArgumentTuple* args = static_cast(untyped_args); - return ResultHolder::PerformAction(action, internal::move(*args)); + return ResultHolder::PerformAction(action, std::move(*args)); } // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): @@ -1594,8 +1592,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // Returns the result of invoking this mock function with the given // arguments. This function can be safely called from multiple // threads concurrently. - Result InvokeWith( - typename RvalueRef::ArgumentTuple>::type args) + Result InvokeWith(typename Function::ArgumentTuple&& args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { // const_cast is required since in C++98 we still pass ArgumentTuple around // by const& instead of rvalue reference. diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 64bf67f..36bd405 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -203,11 +203,6 @@ // GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127 // is suppressed. // -// C++11 feature wrappers: -// -// testing::internal::forward - portability wrapper for std::forward. -// testing::internal::move - portability wrapper for std::move. -// // Synchronization: // Mutex, MutexLock, ThreadLocal, GetThreadCount() // - synchronization primitives. @@ -1257,28 +1252,6 @@ struct ConstRef { typedef T& type; }; #define GTEST_REFERENCE_TO_CONST_(T) \ typename ::testing::internal::ConstRef::type -#if GTEST_HAS_STD_MOVE_ -using std::forward; -using std::move; - -template -struct RvalueRef { - typedef T&& type; -}; -#else // GTEST_HAS_STD_MOVE_ -template -const T& move(const T& t) { - return t; -} -template -GTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; } - -template -struct RvalueRef { - typedef const T& type; -}; -#endif // GTEST_HAS_STD_MOVE_ - // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. // // Use ImplicitCast_ as a safe version of static_cast for upcasting in diff --git a/googletest/include/gtest/internal/gtest-type-util.h.pump b/googletest/include/gtest/internal/gtest-type-util.h.pump index 0001a5d..61c9d36 100644 --- a/googletest/include/gtest/internal/gtest-type-util.h.pump +++ b/googletest/include/gtest/internal/gtest-type-util.h.pump @@ -87,7 +87,7 @@ std::string GetTypeName() { # if GTEST_HAS_CXXABI_H_ using abi::__cxa_demangle; # endif // GTEST_HAS_CXXABI_H_ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); + char* const readable_name = __cxa_demangle(name, nullptr, nullptr, &status); const std::string name_str(status == 0 ? readable_name : name); free(readable_name); return CanonicalizeForStdLibVersioning(name_str); -- cgit v0.12