@@ -176,11 +176,39 @@ class vtable {
176176
177177using CallReactionType = internal::CallReaction (*)(const void *);
178178template <CallReactionType Ptr>
179- struct GetAccess {
179+ struct GetAccessCallReactionType {
180180 friend CallReactionType GetCallReaction () { return Ptr; }
181181};
182182CallReactionType GetCallReaction ();
183- template struct GetAccess <&Mock::GetReactionOnUninterestingCalls>;
183+ template struct GetAccessCallReactionType <
184+ &Mock::GetReactionOnUninterestingCalls>;
185+
186+ using UnregisterCallReactionType = internal::CallReaction (*)(const void *);
187+ template <UnregisterCallReactionType Ptr>
188+ struct GetAccessUnregisterCallReactionType {
189+ friend UnregisterCallReactionType UnregisterCallReaction () { return Ptr; }
190+ };
191+ UnregisterCallReactionType UnregisterCallReaction ();
192+ template struct GetAccessUnregisterCallReactionType <
193+ &Mock::GetReactionOnUninterestingCalls>;
194+
195+ using AllowUninterestingCallsType = void (*)(const void *);
196+ template <AllowUninterestingCallsType Ptr>
197+ struct GetAccessAllowUninterestingCallsType {
198+ friend AllowUninterestingCallsType AllowUninterestingCalls () { return Ptr; }
199+ };
200+ AllowUninterestingCallsType AllowUninterestingCalls ();
201+ template struct GetAccessAllowUninterestingCallsType <
202+ &Mock::AllowUninterestingCalls>;
203+
204+ using FailUninterestingCallsType = void (*)(const void *);
205+ template <FailUninterestingCallsType Ptr>
206+ struct GetAccessFailUninterestingCallsType {
207+ friend FailUninterestingCallsType FailUninterestingCalls () { return Ptr; }
208+ };
209+ FailUninterestingCallsType FailUninterestingCalls ();
210+ template struct GetAccessFailUninterestingCallsType <
211+ &Mock::FailUninterestingCalls>;
184212
185213} // namespace detail
186214
@@ -331,16 +359,18 @@ class NiceMock<GMock<T>> final : public GMock<T> {
331359 public:
332360 template <class ... Ts>
333361 NiceMock (Ts &&... ts) : GMock<T>{std::forward<Ts>(ts)...} {
334- Mock::AllowUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
362+ detail::AllowUninterestingCalls ()(
363+ internal::ImplicitCast_<GMock<T> *>(this ));
335364 }
336365
337366 NiceMock (NiceMock &&) = default ;
338367 NiceMock (const NiceMock &) = delete ;
339368 NiceMock () {
340- Mock::AllowUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
369+ detail::AllowUninterestingCalls ()(
370+ internal::ImplicitCast_<GMock<T> *>(this ));
341371 }
342372 ~NiceMock () {
343- Mock ::UnregisterCallReaction (internal::ImplicitCast_<GMock<T> *>(this ));
373+ detail ::UnregisterCallReaction() (internal::ImplicitCast_<GMock<T> *>(this ));
344374 }
345375};
346376
@@ -349,15 +379,15 @@ class StrictMock<GMock<T>> final : public GMock<T> {
349379 public:
350380 template <class ... Ts>
351381 StrictMock (Ts &&... ts) : GMock<T>{std::forward<Ts>(ts)...} {
352- Mock ::FailUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
382+ detail ::FailUninterestingCalls() (internal::ImplicitCast_<GMock<T> *>(this ));
353383 }
354384 StrictMock (StrictMock &&) = default ;
355385 StrictMock (const StrictMock &) = delete ;
356386 StrictMock () {
357- Mock ::FailUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
387+ detail ::FailUninterestingCalls() (internal::ImplicitCast_<GMock<T> *>(this ));
358388 }
359389 ~StrictMock () {
360- Mock ::UnregisterCallReaction (internal::ImplicitCast_<GMock<T> *>(this ));
390+ detail ::UnregisterCallReaction() (internal::ImplicitCast_<GMock<T> *>(this ));
361391 }
362392};
363393
0 commit comments