blob: 4137e6304b4dbd744e105114c9a86d9cd9d51725 [file] [log] [blame]
Fariborz Jahanian1f990d62008-01-04 00:27:46 +00001// RUN: clang -fsyntax-only -verify %s
2
3typedef struct objc_class *Class;
4typedef 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;
27 for (int * elem in elem) // expected-error {{selector element is not of valid object type (its type is 'int *')}} \
28 expected-error {{collection expression is not of valid object type (its type is 'int *')}}
29 ++i;
30 for (i in elem) // expected-error {{use of undeclared identifier 'elem'}} \
31 expected-error {{selector element is not of valid object type (its type is 'int')}}
32 ++i;
33 for (id se in i) // expected-error {{collection expression is not of valid object type (its type is 'int')}}
34 ++i;
35}
36@end
37