mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Add LIFETIMEBOUND / -Wdangling-gsl to Assert()
This commit is contained in:
@@ -122,6 +122,11 @@ BOOST_AUTO_TEST_CASE(util_check)
|
||||
|
||||
// Check nested Asserts
|
||||
BOOST_CHECK_EQUAL(Assert((Assert(x).test() ? 3 : 0)), 3);
|
||||
|
||||
// Check -Wdangling-gsl does not trigger when copying the int. (It would
|
||||
// trigger on "const int&")
|
||||
const int nine{*Assert(std::optional<int>{9})};
|
||||
BOOST_CHECK_EQUAL(9, nine);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(util_criticalsection)
|
||||
|
||||
Reference in New Issue
Block a user