diff options
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.cpp | 10 |
1 files changed, 10 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 6bcb931e8cf..85711b6e560 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 @@ -202,6 +202,16 @@ void refs_and_vals() { // CHECK-FIXES-NOT: MutableVal &{{[a-z_]+}} = // CHECK-FIXES: {} // CHECK-FIXES-NEXT: alias.x = 0; + + dependent<int> dep, other; + for (dependent<int>::iterator it = dep.begin(), e = dep.end(); it != e; ++it) { + printf("%d\n", *it); + const int& idx = other[0]; + } + // CHECK-MESSAGES: :[[@LINE-4]]: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]; } } // namespace NamingAlias |