diff options
| author | Zinovy Nis <zinovy.nis@gmail.com> | 2018-04-12 05:41:24 +0000 |
|---|---|---|
| committer | Zinovy Nis <zinovy.nis@gmail.com> | 2018-04-12 05:41:24 +0000 |
| commit | dfaa021e990238902823882858b873d96eacb4da (patch) | |
| tree | 2ba150f2a415fd25b1058f3bec736168e764e151 | |
| parent | 8f296478ebbc17daeff51f9d1b84880af5bb726f (diff) | |
| download | bcm5719-llvm-dfaa021e990238902823882858b873d96eacb4da.tar.gz bcm5719-llvm-dfaa021e990238902823882858b873d96eacb4da.zip | |
[clang-tidy] [modernize-use-auto] Get only a length of token, not the token itself
llvm-svn: 329873
| -rw-r--r-- | clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp | 5 |
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); |

