HomePhabricator

refactor: Make const refs vars where applicable and enable related clang-tidy…

Description

refactor: Make const refs vars where applicable and enable related clang-tidy checks

Summary:
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
Automating this check can save us some brain bandwidth during reviews.

This is a backport of core#25707
Depends on D18072

Test Plan:

cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_CLANG_TIDY=ON
ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Aurèle Oulès <aurele@oules.com>Authored on Jul 26 2022, 09:12
PiRKCommitted on May 12 2025, 18:39
PiRKPushed on May 12 2025, 18:39
Reviewer
Restricted Project
Differential Revision
D18073: refactor: Make const refs vars where applicable and enable related clang-tidy checks
Parents
rABC83dd42f64f19: tidy: add readability-redundant-declaration
Branches
Unknown
Tags
Unknown