blob: d0f8404b602724f31e42cd526723ca947ee13ca5 [file] [log] [blame]
Fariborz Jahanian83b7b312010-01-18 22:59:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3@interface G
4@end
5
6@interface F
7- (void)bar:(id *)objects;
8- (void)foo:(G**)objects;
9@end
10
11
12void a() {
13 F *b;
14 G **keys;
15 [b bar:keys];
16
17 id *PID;
18 [b foo:PID];
19
20}
21
Fariborz Jahanian2e2acec2010-08-21 00:10:36 +000022
23// pr7936
24@interface I1 @end
25
26class Wrapper {
27public:
28 operator id() const { return (id)_value; }
29 operator Class() const { return (Class)_value; }
30 operator I1*() const { return (I1*)_value; }
31
32 bool Compare(id obj) { return *this == obj; }
33 bool CompareClass(Class obj) { return *this == obj; }
34 bool CompareI1(I1* obj) { return *this == obj; }
35
Argyrios Kyrtzidis42d0f2a2010-08-23 07:12:16 +000036 Wrapper &operator*();
37 Wrapper &operator[](int);
38 Wrapper& operator->*(int);
39
Fariborz Jahanian2e2acec2010-08-21 00:10:36 +000040private:
41 long _value;
42};
43
Argyrios Kyrtzidis42d0f2a2010-08-23 07:12:16 +000044void f() {
45 Wrapper w;
46 w[0];
47 *w;
48 w->*(0);
49}