WIP: iwyu: Fix warnings in src/test/fuzz and treat them as errors

bitcoin/bitcoin: PR #36808

1 suggestion

Earlier concerns neither republished nor resolved: 2 suggestions. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · The new wallet.h check remains outside IWYU enforcement

src/test/fuzz/util/wallet.h is checked only through the warnings pass, so IWYU-suggested edits to this header do not fail CI despite the expanded fuzz enforcement.

Location: ci/test/03_test_script.sh:271 (head).

Details and suggested fix

The header's only includer is src/wallet/test/fuzz/spend.cpp. The IWYU job's dev-mode preset enables wallet fuzz targets, but FILES_WITH_ENFORCED_IWYU does not match this path, so it enters compile_commands_iwyu_warnings.json. Adding --check_also does not make the header reachable from the errors pass, and the warnings pass prints its resulting diff without checking for changes. Add spend.cpp to the enforced set once it is IWYU-clean, or document that this header check is reporting-only. IWYU was not run, so whether the header produces diagnostics today is unknown.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Upstream testing on Bitcoin Core reported that PR 2142 fixed the private_broadcast.h problem, whereas PR 2145's alternative of skipping constructor/destructor declaration names did not. A reduced Bitcoin-derived reproducer differed by defining the member template's destructor out of line; it passed with 2142 and still failed with 2145.

This directly connects the historical limitation to this header and shows why merely encountering the alternative upstream proposal would not establish that the suppression is unnecessary. These tests concern the reported upstream configurations, not a verified execution of the pinned CI version.

Source 1 · Source 2 · Source 3