Skip to content

Commit

Permalink
explicitly discarding return value of std::string::data() (for FTBFS …
Browse files Browse the repository at this point in the history
…with gcc-13)
  • Loading branch information
ban-nobuhiro committed Jun 5, 2024
1 parent c071d18 commit 8b50b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/takatori/util/optional_ptr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST_F(optional_reference_test, empty) {
optional_ptr<std::string> 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());
}

Expand All @@ -102,7 +102,7 @@ TEST_F(optional_reference_test, nullptr) {
optional_ptr<std::string> 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());
}

Expand Down

0 comments on commit 8b50b61

Please sign in to comment.