diff options
author | Haojian Wu <hokein@google.com> | 2016-02-08 15:59:42 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-02-08 15:59:42 +0000 |
commit | 1e3c32b38a17920a3bc7e598b764dee4bb176b39 (patch) | |
tree | ca2b9d328ae17b71c4ae7825d8c2e55e77641e97 /clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp | |
parent | 45bfe4cc8a07cec3c635da9355c30537f2bfde3b (diff) | |
download | bcm5719-llvm-1e3c32b38a17920a3bc7e598b764dee4bb176b39.tar.gz bcm5719-llvm-1e3c32b38a17920a3bc7e598b764dee4bb176b39.zip |
[clang-tidy] Fix assertion failure on `at` function in modernize-loop-convert.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D16926
llvm-svn: 260107
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp index c50e9238170..b3dfa93d67c 100644 --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp @@ -391,8 +391,8 @@ static bool isAliasDecl(ASTContext *Context, const Decl *TheDecl, // This check is needed because getMethodDecl can return nullptr if the // callee is a member function pointer. const auto *MDecl = MemCall->getMethodDecl(); - if (MDecl && !isa<CXXConversionDecl>(MDecl) && MDecl->getName() == "at") { - assert(MemCall->getNumArgs() == 1); + if (MDecl && !isa<CXXConversionDecl>(MDecl) && MDecl->getName() == "at" && + MemCall->getNumArgs() == 1) { return isIndexInSubscriptExpr(MemCall->getArg(0), IndexVar); } return false; |