diff options
author | Abseil Team <absl-team@google.com> | 2022-11-29 16:43:37 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-11-29 16:44:15 (GMT) |
commit | a16bfcfda1ea994c1abec23cca8f530953042dfa (patch) | |
tree | ed86559e95c65a40b9508ab6e5393be0f98317bf /googlemock/include/gmock/gmock-function-mocker.h | |
parent | e68764c147ea0dac1e8811925c531d937396878e (diff) | |
download | googletest-a16bfcfda1ea994c1abec23cca8f530953042dfa.zip googletest-a16bfcfda1ea994c1abec23cca8f530953042dfa.tar.gz googletest-a16bfcfda1ea994c1abec23cca8f530953042dfa.tar.bz2 |
Disables `-Wunused-member-function` and `-Wused-but-marked-unused` that trigger via `MOCK_METHOD()` and `EXPECT_THAT()` macros.
Fixes: #4052, #4055
PiperOrigin-RevId: 491647393
Change-Id: I8e2ad838156fa8c7e9dccd1740af797e694992b6
Diffstat (limited to 'googlemock/include/gmock/gmock-function-mocker.h')
-rw-r--r-- | googlemock/include/gmock/gmock-function-mocker.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/googlemock/include/gmock/gmock-function-mocker.h b/googlemock/include/gmock/gmock-function-mocker.h index b568aef..7306549 100644 --- a/googlemock/include/gmock/gmock-function-mocker.h +++ b/googlemock/include/gmock/gmock-function-mocker.h @@ -108,8 +108,11 @@ constexpr bool ValidateSpec(const char (&spec)[N]) { using internal::FunctionMocker; } // namespace testing -#define MOCK_METHOD(...) \ - GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__) +#define MOCK_METHOD(...) \ + GMOCK_INTERNAL_WARNING_PUSH() \ + GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-member-function") \ + GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__) \ + GMOCK_INTERNAL_WARNING_POP() #define GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...) \ GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__) |