summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
diff options
context:
space:
mode:
authorAngel Garcia Gomez <angelgarcia@google.com>2015-08-26 14:51:11 +0000
committerAngel Garcia Gomez <angelgarcia@google.com>2015-08-26 14:51:11 +0000
commit446fe8d62ceb6eec9e385dc80f607316e2456e7f (patch)
treee2072dce7be5ad680ef5619b648021a3f1dbd66e /clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
parent9f4709b26115b89dd9e5b87f46347de396b655dd (diff)
downloadbcm5719-llvm-446fe8d62ceb6eec9e385dc80f607316e2456e7f.tar.gz
bcm5719-llvm-446fe8d62ceb6eec9e385dc80f607316e2456e7f.zip
LoopConvert no longer take as alias references to other containers.
Summary: Fix a bug where modernize-loop-convert check would take as alias a reference to other containers. Add the pertinent test. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D12361 llvm-svn: 246034
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
index ac8210f54c9..0058ea6ba60 100644
--- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
@@ -363,7 +363,7 @@ static bool isAliasDecl(const Decl *TheDecl, const VarDecl *IndexVar) {
return isDereferenceOfOpCall(OpCall, IndexVar);
if (OpCall->getOperator() == OO_Subscript) {
assert(OpCall->getNumArgs() == 2);
- return true;
+ return isIndexInSubscriptExpr(OpCall->getArg(1), IndexVar);
}
break;
}
OpenPOWER on IntegriCloud