diff --git a/test/takatori/util/optional_ptr_test.cpp b/test/takatori/util/optional_ptr_test.cpp index eb7e155..ceec460 100644 --- a/test/takatori/util/optional_ptr_test.cpp +++ b/test/takatori/util/optional_ptr_test.cpp @@ -93,7 +93,7 @@ TEST_F(optional_reference_test, empty) { optional_ptr ref; ASSERT_FALSE(ref); EXPECT_THROW(*ref, std::bad_optional_access); - EXPECT_THROW(ref->data(), std::bad_optional_access); + EXPECT_THROW((void) ref->data(), std::bad_optional_access); EXPECT_EQ(ref.begin(), ref.end()); } @@ -102,7 +102,7 @@ TEST_F(optional_reference_test, nullptr) { optional_ptr ref {ptr }; ASSERT_FALSE(ref); EXPECT_THROW(*ref, std::bad_optional_access); - EXPECT_THROW(ref->data(), std::bad_optional_access); + EXPECT_THROW((void) ref->data(), std::bad_optional_access); EXPECT_EQ(ref.begin(), ref.end()); }