aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
index 7519685..5da9240 100644
--- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousStringCompareCheck.cpp
@@ -88,7 +88,7 @@ void SuspiciousStringCompareCheck::registerMatchers(MatchFinder *Finder) {
// Add the list of known string compare-like functions and add user-defined
// functions.
- std::vector<StringRef> FunctionNames = utils::options::parseListPair(
+ const std::vector<StringRef> FunctionNames = utils::options::parseListPair(
KnownStringCompareFunctions, StringCompareLikeFunctions);
// Match a call to a string compare functions.
@@ -163,7 +163,7 @@ void SuspiciousStringCompareCheck::check(
assert(Decl != nullptr && Call != nullptr);
if (Result.Nodes.getNodeAs<Stmt>("missing-comparison")) {
- SourceLocation EndLoc = Lexer::getLocForEndOfToken(
+ const SourceLocation EndLoc = Lexer::getLocForEndOfToken(
Call->getRParenLoc(), 0, Result.Context->getSourceManager(),
getLangOpts());
@@ -173,10 +173,10 @@ void SuspiciousStringCompareCheck::check(
}
if (const auto *E = Result.Nodes.getNodeAs<Expr>("logical-not-comparison")) {
- SourceLocation EndLoc = Lexer::getLocForEndOfToken(
+ const SourceLocation EndLoc = Lexer::getLocForEndOfToken(
Call->getRParenLoc(), 0, Result.Context->getSourceManager(),
getLangOpts());
- SourceLocation NotLoc = E->getBeginLoc();
+ const SourceLocation NotLoc = E->getBeginLoc();
diag(Call->getBeginLoc(),
"function %0 is compared using logical not operator")