HomePhabricator

util/check: stop using lambda for Assert/Assume

Description

util/check: stop using lambda for Assert/Assume

Summary:

wallet: move Assert() check into constructor

This puts it in a function body, so that func is available
for reporting any assertion failure.

util/check: stop using lambda for Assert/Assume

util/check: avoid unused parameter warnings

refactor: Add LIFETIMEBOUND / -Wdangling-gsl to Assert()

Rationale from PR description:

Using a lambda creates a couple of odd namespacing issues, in particular making clang's thread safety analysis less helpful, and confusing gcc when calling member functions. Fix this by not using a lambda.

This is a backport of core#24714, core#24729 and core#25248.

This is a requirement for core#25077 because a lambda cannot be used with LOCK.

Depends on D14620

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14620

Details

Provenance
Anthony Towns <aj@erisian.com.au>Authored on Mar 26 2022, 02:40
PiRKCommitted on Oct 16 2023, 08:44
PiRKPushed on Oct 16 2023, 08:44
Reviewer
Restricted Project
Differential Revision
D14620: util/check: stop using lambda for Assert/Assume
Parents
rABC47e002683420: init: add missing cs_main lock
Branches
Unknown
Tags
Unknown