summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-loop-convert-extra.cpp8
1 files changed, 8 insertions, 0 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 42796f22710..7312b48b9b3 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
@@ -251,8 +251,16 @@ void refs_and_vals() {
// CHECK-FIXES-NEXT: const int& Idx = Other[0];
// CHECK-FIXES-NEXT: unsigned Othersize = Other.size();
+ for (int i = 0; i < Other.size(); ++i) {
+ Other.at(i);
+ }
+ // CHECK-MESSAGES: :[[@LINE-3]]:3: warning: use range-based for loop instead
+ // CHECK-FIXES: for (int & i : Other)
+ // CHECK-FIXES: i;
+
for (int I = 0, E = Dep.size(); I != E; ++I) {
int Idx = Other.at(I);
+ Other.at(I, I); // Should not trigger assert failure.
}
}
OpenPOWER on IntegriCloud