blob: 4bf6b289e7b7b12515b54f869740ec9d9c7c80e6 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Steve Naroffebaa7682009-04-07 15:07:57 +00002
3#include <stddef.h>
4
5typedef struct objc_class *Class;
6typedef struct objc_object {
7 Class isa;
8} *id;
9id objc_getClass(const char *s);
10
11@interface Object
12+ self;
13@end
14
15@protocol Func
16+ (void) class_func0;
17- (void) instance_func0;
18@end
19
20@interface Derived: Object <Func>
21@end
22
23@interface Derived2: Object <Func>
24@end
25
Steve Naroff470301b2009-07-22 16:07:01 +000026static void doSomething(Class <Func> unsupportedObjectType) {
Steve Naroffebaa7682009-04-07 15:07:57 +000027 [unsupportedObjectType class_func0];
28}
29
30static void doSomethingElse(id <Func> pleaseConvertToThisType) {
31 [pleaseConvertToThisType class_func0];
32}
33
34int main(int argv, char *argc[]) {
35 doSomething([Derived self]);
36 doSomething([Derived2 self]);
37 doSomethingElse([Derived self]);
38 doSomethingElse([Derived2 self]);
39}
40