[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
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 @@
// 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];