Skip to content

Commit

Permalink
Add workaround for a GCC bug #verification #sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Feb 6, 2024
1 parent e28bec4 commit 366519d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cetlvast/suites/unittest/test_pf17_optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,12 @@ TYPED_TEST(TestOptionalSpecialFunctionPolicy, Common)
TYPED_TEST(TestOptionalSpecialFunctionPolicy, Exceptions)
{
optional<TypeParam> opt;
EXPECT_THROW((void) opt.value(), cetl::pf17::bad_optional_access);
EXPECT_THROW((void) std::move(opt).value(), cetl::pf17::bad_optional_access);
const auto sink = [](auto&&) {}; // Workaround for GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
EXPECT_THROW(sink(opt.value()), cetl::pf17::bad_optional_access);
EXPECT_THROW(sink(std::move(opt).value()), cetl::pf17::bad_optional_access);
opt.emplace();
EXPECT_NO_THROW((void) opt.value());
EXPECT_NO_THROW((void) std::move(opt).value());
EXPECT_NO_THROW(sink(opt.value()));
EXPECT_NO_THROW(sink(std::move(opt).value()));
}
#endif

Expand Down

0 comments on commit 366519d

Please sign in to comment.