summaryrefslogtreecommitdiff
blob: fa678220f2a1367082e43a18960d56bc8eb1e5c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
taken from upstream repo

Index: include/gmock/gmock-generated-function-mockers.h.pump
===================================================================
--- include/gmock/gmock-generated-function-mockers.h.pump	(revision 227)
+++ include/gmock/gmock-generated-function-mockers.h.pump	(revision 228)
@@ -45,10 +45,6 @@ $var n = 10  $$ The maximum arity we sup
 #include <gmock/internal/gmock-internal-utils.h>
 
 namespace testing {
-
-template <typename F>
-class MockSpec;
-
 namespace internal {
 
 template <typename F>
@@ -89,7 +85,11 @@ $if i >= 1 [[
   }
 
   R Invoke($Aas) {
-    return InvokeWith(ArgumentTuple($as));
+    // 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($as));
   }
 };
 
Index: include/gmock/gmock-generated-function-mockers.h
===================================================================
--- include/gmock/gmock-generated-function-mockers.h	(revision 227)
+++ include/gmock/gmock-generated-function-mockers.h	(revision 228)
@@ -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)> : pu
   }
 
   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)>
   }
 
   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, A
   }
 
   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, A
   }
 
   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, A
   }
 
   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, A
   }
 
   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, A
   }
 
   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, A
 
   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));
   }
 };