[clang-tidy] [modernize-use-auto] Get only a length of token, not the token itself

llvm-svn: 329873
This commit is contained in:
Zinovy Nis 2018-04-12 05:41:24 +00:00
parent 8f296478eb
commit dfaa021e99
1 changed files with 3 additions and 2 deletions

View File

@ -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);