Review report

bitcoin/bitcoin: PR #36384

2 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · The helper test does not check rejection of the legacy alias

The new fixture covers first-name lookup, but an implementation accepting every alias would still satisfy all its assertions.

Location: src/test/rpc_tests.cpp:650 (head).

Details and suggested fix

The declaration def_bool|legacy_def_bool is only accessed through self.Arg<bool>("def_bool"). This checks that the first name works, but not that GetParamIndex rejects the second name as intended. Add BOOST_CHECK_THROW(self.Arg<bool>("legacy_def_bool"), NonFatalCheckError); inside check_positional, with a test_only_CheckFailuresAreExceptionsNotAborts guard in scope, following the existing pattern at line 573. The guard makes the assertion work in builds where failed checks otherwise abort. This strengthens the unit test's coverage of the first-name-only contract.


Link

[suggestion] · The direct iterator dependency is no longer declared

Replacing <iterator> with <ranges> leaves two direct iterator dependencies implicit, contrary to the developer notes, although conforming C++20 libraries still compile this code.

Location: src/rpc/util.cpp:33 (base).

Details and suggested fix

GetParamIndex still uses std::distance, and descriptor expansion still uses std::back_inserter; both are declared in <iterator>. C++20 [ranges.syn] requires <ranges> to include <iterator>, so this is not a compilation defect or a dependency on an implementation-specific include. However, doc/developer-notes.md:1099 requires directly used headers even when they are included indirectly. Keep the explicit <iterator> include to document these dependencies and follow that rule without changing behavior. No IWYU failure has been established.


Coverage details

Earlier concerns

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