blob: d896c35f3f69a28062e35a308be085bef4e88e9a [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian1f990d62008-01-04 00:27:46 +00002
Fariborz Jahanian7f532532011-02-09 22:20:01 +00003struct __objcFastEnumerationState;
Fariborz Jahanian1f990d62008-01-04 00:27:46 +00004typedef struct objc_class *Class;
5typedef struct objc_object {
6 Class isa;
7} *id;
8
9
10@interface MyList
11@end
12
13@implementation MyList
14- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
15{
16 return 0;
17}
18@end
19
20@interface MyList (BasicTest)
21- (void)compilerTestAgainst;
22@end
23
24@implementation MyList (BasicTest)
25- (void)compilerTestAgainst {
26
27 int i=0;
Chris Lattnerd1625842008-11-24 06:25:27 +000028 for (int * elem in elem) // expected-error {{selector element type 'int *' is not a valid object}} \
29 expected-error {{collection expression type 'int *' is not a valid object}}
Fariborz Jahanian1f990d62008-01-04 00:27:46 +000030 ++i;
31 for (i in elem) // expected-error {{use of undeclared identifier 'elem'}} \
Chris Lattnerd1625842008-11-24 06:25:27 +000032 expected-error {{selector element type 'int' is not a valid object}}
Fariborz Jahanian1f990d62008-01-04 00:27:46 +000033 ++i;
Chris Lattnerd1625842008-11-24 06:25:27 +000034 for (id se in i) // expected-error {{collection expression type 'int' is not a valid object}}
Fariborz Jahanian1f990d62008-01-04 00:27:46 +000035 ++i;
36}
37@end
38