Fariborz Jahanian | 1f990d6 | 2008-01-04 00:27:46 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | typedef struct objc_class *Class; |
| 4 | typedef struct objc_object { |
| 5 | Class isa; |
| 6 | } *id; |
| 7 | |
| 8 | |
| 9 | @interface MyList |
| 10 | @end |
| 11 | |
| 12 | @implementation MyList |
| 13 | - (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount |
| 14 | { |
| 15 | return 0; |
| 16 | } |
| 17 | @end |
| 18 | |
| 19 | @interface MyList (BasicTest) |
| 20 | - (void)compilerTestAgainst; |
| 21 | @end |
| 22 | |
| 23 | @implementation MyList (BasicTest) |
| 24 | - (void)compilerTestAgainst { |
| 25 | |
| 26 | int i=0; |
Chris Lattner | d162584 | 2008-11-24 06:25:27 +0000 | [diff] [blame] | 27 | for (int * elem in elem) // expected-error {{selector element type 'int *' is not a valid object}} \ |
| 28 | expected-error {{collection expression type 'int *' is not a valid object}} |
Fariborz Jahanian | 1f990d6 | 2008-01-04 00:27:46 +0000 | [diff] [blame] | 29 | ++i; |
| 30 | for (i in elem) // expected-error {{use of undeclared identifier 'elem'}} \ |
Chris Lattner | d162584 | 2008-11-24 06:25:27 +0000 | [diff] [blame] | 31 | expected-error {{selector element type 'int' is not a valid object}} |
Fariborz Jahanian | 1f990d6 | 2008-01-04 00:27:46 +0000 | [diff] [blame] | 32 | ++i; |
Chris Lattner | d162584 | 2008-11-24 06:25:27 +0000 | [diff] [blame] | 33 | for (id se in i) // expected-error {{collection expression type 'int' is not a valid object}} |
Fariborz Jahanian | 1f990d6 | 2008-01-04 00:27:46 +0000 | [diff] [blame] | 34 | ++i; |
| 35 | } |
| 36 | @end |
| 37 | |