Niclas Larsson b7ced159db Avoid is_constructible recursion in OnceAction
Both OnceAction compatibility traits, IsDirectlyCompatible and
IsCompatibleAfterIgnoringArguments, check std::is_constructible before
is_callable_r.

On libc++ that order breaks. Evaluating
is_constructible<std::tuple<OnceAction&&>, ...> drives libc++'s tuple
constructor SFINAE, which calls back into OnceAction's converting
constructor and re-enters the conjunction while it is still incomplete.
GCC <= 8 (e.g. QNX 7.1's gcc 8.3) rejects this with:

    incomplete type ... used in nested name specifier

so EXPECT_CALL(m, f()).WillOnce(Return(...)) fails to compile. GCC >= 9
and every Clang accept the original order; libstdc++ is unaffected.

Swapping the two checks fixes it: is_callable_r is cheap and
non-recursive, so the conjunction short-circuits to false for the
non-callable tuple before is_constructible is instantiated.

Fixes #3947.
2026-06-04 19:56:55 +02:00
..
internal Double the MOCK_METHOD parameter count limit to mitigate users running into it 2026-05-15 11:11:10 -07:00
gmock-actions.h Avoid is_constructible recursion in OnceAction 2026-06-04 19:56:55 +02:00
gmock-cardinalities.h Add [[nodiscard]] throughput Google Test. 2025-12-08 12:55:11 -08:00
gmock-function-mocker.h Merge pull request #4374 from masbug:main 2023-09-25 14:00:54 -07:00
gmock-matchers.h Introduce ContainsSubsequence matcher. 2026-05-20 02:39:49 -07:00
gmock-more-actions.h GoogleTest C++17 cleanups 2025-02-21 07:33:55 -08:00
gmock-more-matchers.h Add [[nodiscard]] throughput Google Test. 2025-12-08 12:55:11 -08:00
gmock-nice-strict.h Add [[nodiscard]] throughput Google Test. 2025-12-08 12:55:11 -08:00
gmock-spec-builders.h gmock-spec-builders: support mocking const-qualified function types. 2026-05-26 01:30:54 -07:00
gmock.h Export gmock-spec-builders. 2023-10-26 13:15:23 -07:00