blob: d67a714dafa0a6fd91a02a962461f33288ba0af7 [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;
Chris Lattnerd1625842008-11-24 06:25:27 +000027 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 Jahanian1f990d62008-01-04 00:27:46 +000029 ++i;
30 for (i in elem) // expected-error {{use of undeclared identifier 'elem'}} \
Chris Lattnerd1625842008-11-24 06:25:27 +000031 expected-error {{selector element type 'int' is not a valid object}}
Fariborz Jahanian1f990d62008-01-04 00:27:46 +000032 ++i;
Chris Lattnerd1625842008-11-24 06:25:27 +000033 for (id se in i) // expected-error {{collection expression type 'int' is not a valid object}}
Fariborz Jahanian1f990d62008-01-04 00:27:46 +000034 ++i;
35}
36@end
37