HomePhabricator

Fix clang-tidy readability-const-return-type violations

Description

Fix clang-tidy readability-const-return-type violations

Summary:

This comes up during review, so instead of wasting review cycles on this, just enforce it via CI

From the clang-tidy doc:

Such use of const is usually superfluous, and can prevent valuable compiler optimizations. Does not (yet) fix trailing return types.

I have never seen it mentioned in our reviews, but my IDE flags these issues, and it can maybe save us some merge conflicts during backports.

This is a backport of core#26395
Depends on D18073

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

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

Details

Provenance
MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>Authored on Jan 20 2023, 15:25
PiRKCommitted on May 12 2025, 18:39
PiRKPushed on May 12 2025, 18:39
Reviewer
Restricted Project
Differential Revision
D18074: Fix clang-tidy readability-const-return-type violations
Parents
rABC656fea8be36d: refactor: Make const refs vars where applicable and enable related clang-tidy…
Branches
Unknown
Tags
Unknown