gtest: Supress warning about set unused variable

Modified test ExpectThrowTest.DoesNotGenerateUnreachableCodeWarning
This commit is contained in:
Patryk Gawroński 2023-07-27 01:45:41 +02:00
parent 40412d8512
commit 2f83a6e8f8

View File

@ -4109,7 +4109,7 @@ TEST(AssertionSyntaxTest, BasicAssertionsBehavesLikeSingleStatement) {
// Tests that the compiler will not complain about unreachable code in the
// EXPECT_THROW/EXPECT_ANY_THROW/EXPECT_NO_THROW macros.
TEST(ExpectThrowTest, DoesNotGenerateUnreachableCodeWarning) {
int n = 0;
[[maybe_unused]] int n{0};
EXPECT_THROW(throw 1, int);
EXPECT_NONFATAL_FAILURE(EXPECT_THROW(n++, int), "");