enabled and mitigated `readability-const-return-type` clang-tidy warnings (#5644)

This commit is contained in:
Oliver Stöneberg 2023-11-24 18:45:48 +01:00 committed by GitHub
parent 331db40d3b
commit 86bb7c98e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 4 deletions

View File

@ -59,7 +59,6 @@ Checks: >
-portability-std-allocator-const, -portability-std-allocator-const,
-readability-avoid-const-params-in-decls, -readability-avoid-const-params-in-decls,
-readability-braces-around-statements, -readability-braces-around-statements,
-readability-const-return-type,
-readability-container-data-pointer, -readability-container-data-pointer,
-readability-function-cognitive-complexity, -readability-function-cognitive-complexity,
-readability-function-size, -readability-function-size,

View File

@ -118,7 +118,6 @@ Also reports a false positive about templates which deduce the array length: htt
We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as the findings of the include checkers still need to be reviewed manually before applying them. We run this separately via `clang-include-cleaner` in the `iwyu.yml` workflow as the findings of the include checkers still need to be reviewed manually before applying them.
`bugprone-branch-clone`<br/> `bugprone-branch-clone`<br/>
`readability-const-return-type`<br/>
`modernize-return-braced-init-list`<br/> `modernize-return-braced-init-list`<br/>
`misc-throw-by-value-catch-by-reference`<br/> `misc-throw-by-value-catch-by-reference`<br/>
`readability-avoid-const-params-in-decls`<br/> `readability-avoid-const-params-in-decls`<br/>

View File

@ -24,7 +24,7 @@
#include <QStringList> #include <QStringList>
#include <QtTest> #include <QtTest>
static const QStringList getTranslationNames(const TranslationHandler& handler) static QStringList getTranslationNames(const TranslationHandler& handler)
{ {
QStringList names; QStringList names;
for (const TranslationInfo& translation : handler.getTranslations()) { for (const TranslationInfo& translation : handler.getTranslations()) {

View File

@ -59,7 +59,7 @@ struct Standards {
} }
return false; return false;
} }
const std::string getC() const { std::string getC() const {
switch (c) { switch (c) {
case C89: case C89:
return "c89"; return "c89";

View File

@ -36,6 +36,7 @@
struct SelectMapKeys { struct SelectMapKeys {
template<class Pair> template<class Pair>
// NOLINTNEXTLINE(readability-const-return-type) - false positive
typename Pair::first_type operator()(const Pair& p) const { typename Pair::first_type operator()(const Pair& p) const {
return p.first; return p.first;
} }