diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index 69e42bc6..42340a2d 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -201,6 +201,7 @@ TEST(gtest_extra_test, expect_write_streaming) { // EXPECT_THROW_MSG macro. TEST(gtest_extra_test, expect_throw_no_unreachable_code_warning) { int n = 0; + (void)n; using std::runtime_error; EXPECT_THROW_MSG(throw runtime_error(""), runtime_error, ""); EXPECT_NONFATAL_FAILURE(EXPECT_THROW_MSG(n++, runtime_error, ""), ""); @@ -213,6 +214,7 @@ TEST(gtest_extra_test, expect_throw_no_unreachable_code_warning) { // EXPECT_SYSTEM_ERROR macro. TEST(gtest_extra_test, expect_system_error_no_unreachable_code_warning) { int n = 0; + (void)n; EXPECT_SYSTEM_ERROR(throw fmt::system_error(EDOM, "test"), EDOM, "test"); EXPECT_NONFATAL_FAILURE(EXPECT_SYSTEM_ERROR(n++, EDOM, ""), ""); EXPECT_NONFATAL_FAILURE(EXPECT_SYSTEM_ERROR(throw 1, EDOM, ""), "");