[PATCH] D18141: [clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-convert` check.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 14 05:46:31 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263426: [clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize… (authored by hokein).
Changed prior to commit:
http://reviews.llvm.org/D18141?vs=50580&id=50582#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18141
Files:
clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
Index: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
@@ -391,8 +391,8 @@
// 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" &&
- MemCall->getNumArgs() == 1) {
+ if (MDecl && !isa<CXXConversionDecl>(MDecl) &&
+ MDecl->getNameAsString() == "at" && MemCall->getNumArgs() == 1) {
return isIndexInSubscriptExpr(MemCall->getArg(0), IndexVar);
}
return false;
Index: clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-loop-convert-basic.cpp
@@ -320,6 +320,10 @@
// CHECK-FIXES: for (auto & It : Uu)
// CHECK-FIXES-NEXT: printf("s has value %d\n", It.X);
+ for (U::iterator It = Uu.begin(), E = Uu.end(); It != E; ++It) {
+ Val* a = It.operator->();
+ }
+
U::iterator A;
for (U::iterator I = Uu.begin(), E = Uu.end(); I != E; ++I)
int K = A->X + I->X;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18141.50582.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160314/11001324/attachment.bin>
More information about the cfe-commits
mailing list