[clang-tools-extra] dfc46f0 - [clang-tidy] Drop unnecessary const from return types (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 5 08:37:42 PDT 2021
Author: Kazu Hirata
Date: 2021-09-05T08:37:27-07:00
New Revision: dfc46f02681447370a1ccbe340034e970bc7e572
URL: https://github.com/llvm/llvm-project/commit/dfc46f02681447370a1ccbe340034e970bc7e572
DIFF: https://github.com/llvm/llvm-project/commit/dfc46f02681447370a1ccbe340034e970bc7e572.diff
LOG: [clang-tidy] Drop unnecessary const from return types (NFC)
Identified with readability-const-return-type.
Added:
Modified:
clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
index 9ff94a009d0dd..169b828a3c926 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
@@ -83,7 +83,7 @@ static bool isSafeAssignment(const FieldDecl *Field, const Expr *Init,
.empty();
}
-static const std::pair<const FieldDecl *, const Expr *>
+static std::pair<const FieldDecl *, const Expr *>
isAssignmentToMemberOf(const CXXRecordDecl *Rec, const Stmt *S,
const CXXConstructorDecl *Ctor) {
if (const auto *BO = dyn_cast<BinaryOperator>(S)) {
diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
index 5126d76a2268a..0ff0708adc4a5 100644
--- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -534,7 +534,7 @@ bool IdentifierNamingCheck::HungarianNotation::removeDuplicatedPrefix(
return false;
}
-const std::string IdentifierNamingCheck::HungarianNotation::getDataTypePrefix(
+std::string IdentifierNamingCheck::HungarianNotation::getDataTypePrefix(
StringRef TypeName, const NamedDecl *ND,
const IdentifierNamingCheck::HungarianNotationOption &HNOption) const {
if (!ND || TypeName.empty())
diff --git a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
index ac8cfc8b4d51e..da303d785b8a4 100644
--- a/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
+++ b/clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.h
@@ -109,7 +109,7 @@ class IdentifierNamingCheck final : public RenamerClangTidyCheck {
const Decl *D,
const IdentifierNamingCheck::HungarianNotationOption &HNOption) const;
- const std::string getDataTypePrefix(
+ std::string getDataTypePrefix(
StringRef TypeName, const NamedDecl *ND,
const IdentifierNamingCheck::HungarianNotationOption &HNOption) const;
More information about the cfe-commits
mailing list