readability-const-return-type: don't diagnose a template function returning T, even...
authorAndy Getzendanner <durandal@google.com>
Mon, 23 Jan 2023 13:36:55 +0000 (13:36 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Mon, 23 Jan 2023 22:08:12 +0000 (22:08 +0000)
commit9a11b23c0238ebfa0210ce89dee97f68ae3dfbd4
tree138786e24c527f10099330a6d54dbf1a9f377dc5
parent96fdfd46dae264e923ff911d5399938f39d00416
readability-const-return-type: don't diagnose a template function returning T, even if sometimes instantiated with e.g. T = const int.

It's not really a readability problem since there's no `const` to read at the declaration site, and returning std::remove_const_t<T> instead usually only hurts readability.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D140434
clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp