From 8736d2cd5c1dcba41170ed2fddca14021d4916c3 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 26 May 2026 01:30:27 -0700 Subject: [PATCH] `gmock-spec-builders`: support mocking const-qualified function types. In particular this automatically gives us support for examples like the following: using SomeFn = absl::AnyInvocable; MockFunction some_fn; PiperOrigin-RevId: 921303527 Change-Id: I19bf59671781e85db65cc20c0d6ea10b056c528a --- .../include/gmock/gmock-spec-builders.h | 5 ++ googlemock/test/gmock-function-mocker_test.cc | 73 ++++++++++++++++--- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 5cb10c096..1be93588c 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -1957,6 +1957,11 @@ struct SignatureOf { using type = R(Args...); }; +template +struct SignatureOf { + using type = R(Args...); +}; + template