Index: testing/gmock/include/gmock/gmock-generated-function-mockers.h |
diff --git a/testing/gmock/include/gmock/gmock-generated-function-mockers.h b/testing/gmock/include/gmock/gmock-generated-function-mockers.h |
index 3002b6c59685366e6df5c09d9ee96d1801ab85d2..3b2ede1e763ebaa15e00f3ca436f30496f58f0ed 100644 |
--- a/testing/gmock/include/gmock/gmock-generated-function-mockers.h |
+++ b/testing/gmock/include/gmock/gmock-generated-function-mockers.h |
@@ -42,10 +42,6 @@ |
#include <gmock/internal/gmock-internal-utils.h> |
namespace testing { |
- |
-template <typename F> |
-class MockSpec; |
- |
namespace internal { |
template <typename F> |
@@ -71,7 +67,11 @@ class FunctionMocker<R()> : public |
} |
R Invoke() { |
- return InvokeWith(ArgumentTuple()); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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()); |
} |
}; |
@@ -88,7 +88,11 @@ class FunctionMocker<R(A1)> : public |
} |
R Invoke(A1 a1) { |
- return InvokeWith(ArgumentTuple(a1)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1)); |
} |
}; |
@@ -105,7 +109,11 @@ class FunctionMocker<R(A1, A2)> : public |
} |
R Invoke(A1 a1, A2 a2) { |
- return InvokeWith(ArgumentTuple(a1, a2)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2)); |
} |
}; |
@@ -123,7 +131,11 @@ class FunctionMocker<R(A1, A2, A3)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3)); |
} |
}; |
@@ -141,7 +153,11 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4)); |
} |
}; |
@@ -161,7 +177,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5)); |
} |
}; |
@@ -182,7 +202,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5, a6)); |
} |
}; |
@@ -203,7 +227,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5, a6, a7)); |
} |
}; |
@@ -224,7 +252,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5, a6, a7, a8)); |
} |
}; |
@@ -246,7 +278,11 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public |
} |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5, a6, a7, a8, a9)); |
} |
}; |
@@ -270,7 +306,12 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public |
R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, |
A10 a10) { |
- return InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)); |
+ // Even though gcc and MSVC don't enforce it, 'this->' is required |
+ // 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(a1, a2, a3, a4, a5, a6, a7, a8, a9, |
+ a10)); |
} |
}; |
@@ -753,66 +794,116 @@ class MockFunction; |
template <typename R> |
class MockFunction<R()> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD0_T(Call, R()); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0> |
class MockFunction<R(A0)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD1_T(Call, R(A0)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1> |
class MockFunction<R(A0, A1)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD2_T(Call, R(A0, A1)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2> |
class MockFunction<R(A0, A1, A2)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD3_T(Call, R(A0, A1, A2)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3> |
class MockFunction<R(A0, A1, A2, A3)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD4_T(Call, R(A0, A1, A2, A3)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A4> |
class MockFunction<R(A0, A1, A2, A3, A4)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A4, typename A5> |
class MockFunction<R(A0, A1, A2, A3, A4, A5)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A4, typename A5, typename A6> |
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A4, typename A5, typename A6, typename A7> |
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A4, typename A5, typename A6, typename A7, typename A8> |
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
template <typename R, typename A0, typename A1, typename A2, typename A3, |
@@ -820,7 +911,12 @@ template <typename R, typename A0, typename A1, typename A2, typename A3, |
typename A9> |
class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> { |
public: |
+ MockFunction() {} |
+ |
MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)); |
+ |
+ private: |
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction); |
}; |
} // namespace testing |