Skip to content

Commit

Permalink
gtest: Supress warning about set unused variable
Browse files Browse the repository at this point in the history
Modified test ExpectThrowTest.DoesNotGenerateUnreachableCodeWarning
  • Loading branch information
pgawro committed Jul 26, 2023
1 parent 40412d8 commit 2f83a6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion googletest/test/gtest_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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), "");
Expand Down

0 comments on commit 2f83a6e

Please sign in to comment.