summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
index 23478aefeb2..75e84c1f67b 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
@@ -11,6 +11,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
+#include "clang/Lex/Lexer.h"
#include "clang/Tooling/FixIt.h"
using namespace clang;
@@ -419,8 +420,8 @@ void UseAutoCheck::replaceExpr(
SourceRange Range(Loc.getSourceRange());
if (MinTypeNameLength != 0 &&
- tooling::fixit::getText(Loc.getSourceRange(), FirstDecl->getASTContext())
- .size() < MinTypeNameLength)
+ Lexer::MeasureTokenLength(Loc.getLocStart(), Context->getSourceManager(),
+ getLangOpts()) < MinTypeNameLength)
return;
auto Diag = diag(Range.getBegin(), Message);
OpenPOWER on IntegriCloud