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
This commit is contained in:
committed by
Copybara-Service
parent
e68764c147
commit
a16bfcfda1
@@ -1615,6 +1615,20 @@ TEST(MatcherPMacroTest, WorksOnMoveOnlyType) {
|
||||
EXPECT_THAT(p, Not(UniquePointee(2)));
|
||||
}
|
||||
|
||||
MATCHER(EnsureNoUnusedButMarkedUnusedWarning, "") { return (arg % 2) == 0; }
|
||||
|
||||
TEST(MockMethodMockFunctionTest, EnsureNoUnusedButMarkedUnusedWarning) {
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic error "-Wused-but-marked-unused"
|
||||
#endif
|
||||
// https://github.com/google/googletest/issues/4055
|
||||
EXPECT_THAT(0, EnsureNoUnusedButMarkedUnusedWarning());
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
#if GTEST_HAS_EXCEPTIONS
|
||||
|
||||
// std::function<void()> is used below for compatibility with older copies of
|
||||
|
||||
Reference in New Issue
Block a user