diff options
| author | Angel Garcia Gomez <angelgarcia@google.com> | 2015-08-26 17:08:24 +0000 |
|---|---|---|
| committer | Angel Garcia Gomez <angelgarcia@google.com> | 2015-08-26 17:08:24 +0000 |
| commit | 8409e88fdef77a4970b067706d24cd70a347aadd (patch) | |
| tree | 80e6a94ea04ec5d63fa05d54ea73021d4a852276 /clang-tools-extra/test | |
| parent | bf891b12b4a8fe0e64f89101e1d4ff451de923ec (diff) | |
| download | bcm5719-llvm-8409e88fdef77a4970b067706d24cd70a347aadd.tar.gz bcm5719-llvm-8409e88fdef77a4970b067706d24cd70a347aadd.zip | |
Fix another LoopConvert fail.
Summary: Prevent LoopConvert from taking as alias anything that comes from a random member function call.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D12370
llvm-svn: 246039
Diffstat (limited to 'clang-tools-extra/test')
| -rw-r--r-- | clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp index 85711b6e560..4095d1057dd 100644 --- a/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp +++ b/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp @@ -207,11 +207,17 @@ void refs_and_vals() { for (dependent<int>::iterator it = dep.begin(), e = dep.end(); it != e; ++it) { printf("%d\n", *it); const int& idx = other[0]; + unsigned othersize = other.size(); } - // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead + // CHECK-MESSAGES: :[[@LINE-5]]:3: warning: use range-based for loop instead // CHECK-FIXES: for (auto & elem : dep) // CHECK-FIXES-NEXT: printf("%d\n", elem); // CHECK-FIXES-NEXT: const int& idx = other[0]; + // CHECK-FIXES-NEXT: unsigned othersize = other.size(); + + for (int i = 0, e = dep.size(); i != e; ++i) { + int idx = other.at(i); + } } } // namespace NamingAlias |

