| // RUN: %clang_cc1 -fsyntax-only -fblocks -verify -std=c++11 %s |
| for (int i : a); // expected-error{{selector element type 'int' is not a valid object}} |
| for ((id)2 : a); // expected-error {{for range declaration must declare a variable}} \ |
| // expected-warning {{expression result unused}} |
| for (2 : a); // expected-error {{for range declaration must declare a variable}} \ |
| // expected-warning {{expression result unused}} |
| @interface NSObject <NSObject> { |
| unsigned long *mutationsPtr; |
| } NSFastEnumerationState; |
| @protocol NSFastEnumeration |
| - (unsigned long)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(unsigned long)len; |
| NSObject<NSFastEnumeration>* collection = 0; |
| for (id thing : collection) { } |
| for (int (^b)(void) : array) { |
| /* rdar://problem/11068137 */ |
| @property (assign) id prop; |
| void test2(NSObject<NSFastEnumeration> *collection) { |
| for (obj.prop : collection) { // expected-error {{for range declaration must declare a variable}} \ |
| // expected-warning {{property access result unused - getters should not be used for side effects}} |