Debian Codegraph @

clang/test/SemaObjC/warn-loop-analysis.m

raw
1 // RUN: %clang_cc1 -fsyntax-only -Wloop-analysis -verify %s
2 // expected-no-diagnostics
3
4 @interface MyArray
5 - (id)objectAtIndexedSubscript:(unsigned int)idx;
6 @end
7
8 // Do not warn on objc classes has objectAtIndexedSubscript method.
9 MyArray *test;
10 void foo(void)
11 {
12 unsigned int i;
13 for (i = 42; i > 0;) // No warnings here
14 (void)test[--i];
15 }