blob: 6aa74c9c0b45dd429310b16ccf12964a49add74a [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian8ce5da32008-01-07 17:52:35 +00002
3typedef struct objc_class *Class;
Fariborz Jahanian7f532532011-02-09 22:20:01 +00004struct __objcFastEnumerationState;
Fariborz Jahanian8ce5da32008-01-07 17:52:35 +00005typedef struct objc_object {
6 Class isa;
7} *id;
8
Fariborz Jahanian8ce5da32008-01-07 17:52:35 +00009@protocol P @end
10
11@interface MyList
12@end
13
14@implementation MyList
15- (unsigned int)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state objects: (id *)items count:(unsigned int)stackcount
16{
17 return 0;
18}
19@end
20
21@interface MyList (BasicTest)
22- (void)compilerTestAgainst;
23@end
24
25@implementation MyList (BasicTest)
26- (void)compilerTestAgainst {
Chris Lattner35d276f2009-02-27 18:53:28 +000027 static i;// expected-warning {{type specifier missing, defaults to 'int'}}
Douglas Gregorc1ced282009-02-13 18:20:19 +000028 for (id el, elem in self) // expected-error {{only one element declaration is allowed}}
Fariborz Jahanian8ce5da32008-01-07 17:52:35 +000029 ++i;
30 for (id el in self)
31 ++i;
32 MyList<P> ***p;
Chris Lattnerd1625842008-11-24 06:25:27 +000033 for (p in self) // expected-error {{selector element type 'MyList<P> ***' is not a valid object type}}
Fariborz Jahanian8ce5da32008-01-07 17:52:35 +000034 ++i;
35
36}
37@end
38