Repository: bitcoin/bitcoin (language: cpp)

Issue:
`Wunused-member-function` in test each commit
#31045 introduced `-werror` to test each commit, which makes things like `Wunused-member-function` an error now. 

This feels pretty aggressive in the cases where some methods may be defined in isolation in commit A, and then used elsewhere in commit B (following A).


Discussion / hints:
I empathize that it's a little bit harsh to raise on this, but unsure if it is an issue in practice. As a reviewer, my preference is for the member or method to be used in the commit where it is added. This helps to more easily understand why it was added, and aids in reviewing the change without needing to flip repeatedly between the commits or git rebasing to squash them together.
It may be trivial to suppress either way by using https://en.cppreference.com/w/cpp/language/attributes/maybe_unused in the commit?

It should also be trivial to remove the error completely from the CI task by specifying `Wno-error=unused-member-function`?
> It may be trivial to suppress either way by using https://en.cppreference.com/w/cpp/language/attributes/maybe_unused in the commit?
> 
> It should also be trivial to remove the error completely from the CI task by specifying `Wno-error=unused-member-function`?

Agreed on both. The purpose of the issue was mostly to agree on what the expectations are for methods that may be used within the same PR but not within the commit they were defined in.

Will open a PR adding `Wno-error=unused-member-function` to test each commit and see if there is consensus on this

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5da60e13bd310..cd6a2839b568c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -72,7 +72,7 @@ jobs:
         run: |
           # Run tests on commits after the last merge commit and before the PR head commit
           # Use clang++, because it is a bit faster and uses less memory than g++
-          git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON && cmake --build build -j $(nproc) && ctest --output-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
+          git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_BDB=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' && cmake --build build -j $(nproc) && ctest --output-on-failure --test-dir build -j $(nproc) && ./build/test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
 
   macos-native-arm64:
     name: 'macOS 14 native, arm64, no depends, sqlite only, gui'


Test patch: