diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-08-08 10:43:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-08-08 10:43:11 +0000 |
commit | b41c91c3897c0b70b1a8e1b682b6ddcd78a86b6a (patch) | |
tree | 3322f5fae3ba81b8c71f949d674ba55b97a75c0b /clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp | |
parent | 35837ac9a934ab77422f3eb60da18f7d051f3692 (diff) | |
download | llvm-b41c91c3897c0b70b1a8e1b682b6ddcd78a86b6a.zip llvm-b41c91c3897c0b70b1a8e1b682b6ddcd78a86b6a.tar.gz llvm-b41c91c3897c0b70b1a8e1b682b6ddcd78a86b6a.tar.bz2 |
[clang-tidy] Don't index past the end of a vector.
We actually want the end iterator so just replace it with iterator arithmetic.
llvm-svn: 215195
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp index 2060a4d..24647f8 100644 --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp @@ -107,7 +107,8 @@ void IncludeOrderPPCallbacks::EndOfMainFile() { // Sort the includes. We first sort by priority, then lexicographically. for (unsigned BI = 0, BE = Blocks.size() - 1; BI != BE; ++BI) - std::sort(&IncludeIndices[Blocks[BI]], &IncludeIndices[Blocks[BI + 1]], + std::sort(IncludeIndices.begin() + Blocks[BI], + IncludeIndices.begin() + Blocks[BI + 1], [this](unsigned LHSI, unsigned RHSI) { IncludeDirective &LHS = IncludeDirectives[LHSI]; IncludeDirective &RHS = IncludeDirectives[RHSI]; |