diff options
author | Patryk Gawroński <patryk@pgawro.com> | 2023-07-27 01:45:41 +0200 |
---|---|---|
committer | Patryk Gawroński <patryk@pgawro.com> | 2023-07-27 01:49:57 +0200 |
commit | 2f83a6e8f8aa56335f8b6a4d72c0a6841dcfa985 (patch) | |
tree | 182e519c24d2d18e6c7651bd053d29e0812c7d19 /googletest | |
parent | 40412d85124f7c6f3d88454583c4633e5e10fc8c (diff) | |
download | googletest-2f83a6e8f8aa56335f8b6a4d72c0a6841dcfa985.zip googletest-2f83a6e8f8aa56335f8b6a4d72c0a6841dcfa985.tar.gz googletest-2f83a6e8f8aa56335f8b6a4d72c0a6841dcfa985.tar.bz2 |
gtest: Supress warning about set unused variable
Modified test ExpectThrowTest.DoesNotGenerateUnreachableCodeWarning
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/test/gtest_unittest.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index 6caa03f..b1cbddf 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -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), ""); |