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<R(Args...) const>;
    MockFunction<SomeFn> some_fn;

PiperOrigin-RevId: 921303527
Change-Id: I19bf59671781e85db65cc20c0d6ea10b056c528a
This commit is contained in:
Aaron Jacobs
2026-05-26 01:30:54 -07:00
committed by Copybara-Service
parent 09f45f51fb
commit 8736d2cd5c
2 changed files with 68 additions and 10 deletions
@@ -1957,6 +1957,11 @@ struct SignatureOf<R(Args...)> {
using type = R(Args...);
};
template <typename R, typename... Args>
struct SignatureOf<R(Args...) const> {
using type = R(Args...);
};
template <template <typename> class C, typename F>
struct SignatureOf<C<F>,
typename std::enable_if<std::is_function<F>::value>::type>