[all-commits] [llvm/llvm-project] 9a11b2: readability-const-return-type: don't diagnose a te...
Andy Getz via All-commits
all-commits at lists.llvm.org
Mon Jan 23 14:08:59 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9a11b23c0238ebfa0210ce89dee97f68ae3dfbd4
https://github.com/llvm/llvm-project/commit/9a11b23c0238ebfa0210ce89dee97f68ae3dfbd4
Author: Andy Getzendanner <durandal at google.com>
Date: 2023-01-23 (Mon, 23 Jan 2023)
Changed paths:
M clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp
M clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp
Log Message:
-----------
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
More information about the All-commits
mailing list