From 8b50b61022ee7f7d578bf889ca2c8b429ad206d0 Mon Sep 17 00:00:00 2001 From: Nobuhiro Ban Date: Wed, 5 Jun 2024 21:52:54 +0900 Subject: [PATCH] explicitly discarding return value of std::string::data() (for FTBFS with gcc-13) --- test/takatori/util/optional_ptr_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()); }