From f5847cf84c4c965ea416a22f194a61c201abeb6a Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 4 Aug 2014 10:11:47 +0000 Subject: [PATCH] [clang-tidy] Rewrite a for-range loop in the old style. Haven't thought that I ever needed to do this, but in this case comparing the index using pointer arithmetic turns out to be really ugly. It also generates nasty sign-compare warnings on 32 bit targets. llvm-svn: 214705 --- clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp index 5357b7c..4f7b535 100644 --- a/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp @@ -86,10 +86,10 @@ ArgumentCommentCheck::isLikelyTypo(llvm::ArrayRef Params, if (ThisED >= UpperBound) return false; - for (const auto &Param : Params) { - if (&Param - Params.begin() == ArgIndex) + for (unsigned I = 0, E = Params.size(); I != E; ++I) { + if (I == ArgIndex) continue; - IdentifierInfo *II = Param->getIdentifier(); + IdentifierInfo *II = Params[I]->getIdentifier(); if (!II) continue; -- 2.7.4