aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp b/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp
index afa59f3..c8c0cfd 100644
--- a/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/MisplacedConstCheck.cpp
@@ -40,7 +40,7 @@ static QualType guessAlternateQualification(ASTContext &Context, QualType QT) {
Qualifiers Quals = QT.getLocalQualifiers();
Quals.removeConst();
- QualType NewQT = Context.getPointerType(
+ const QualType NewQT = Context.getPointerType(
QualType(QT->getPointeeType().getTypePtr(), Qualifiers::Const));
return NewQT.withCVRQualifiers(Quals.getCVRQualifiers());
}
@@ -48,7 +48,7 @@ static QualType guessAlternateQualification(ASTContext &Context, QualType QT) {
void MisplacedConstCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Var = Result.Nodes.getNodeAs<ValueDecl>("decl");
ASTContext &Ctx = *Result.Context;
- QualType CanQT = Var->getType().getCanonicalType();
+ const QualType CanQT = Var->getType().getCanonicalType();
SourceLocation AliasLoc;
const char *AliasType = nullptr;