Fariborz Jahanian | 83b7b31 | 2010-01-18 22:59:22 +0000 | [diff] [blame] | 1 | // 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 | |
| 12 | void a() { |
| 13 | F *b; |
| 14 | G **keys; |
| 15 | [b bar:keys]; |
| 16 | |
| 17 | id *PID; |
| 18 | [b foo:PID]; |
| 19 | |
| 20 | } |
| 21 | |
Fariborz Jahanian | 2e2acec | 2010-08-21 00:10:36 +0000 | [diff] [blame] | 22 | |
| 23 | // pr7936 |
| 24 | @interface I1 @end |
| 25 | |
| 26 | class Wrapper { |
| 27 | public: |
| 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 Kyrtzidis | 42d0f2a | 2010-08-23 07:12:16 +0000 | [diff] [blame] | 36 | Wrapper &operator*(); |
| 37 | Wrapper &operator[](int); |
| 38 | Wrapper& operator->*(int); |
| 39 | |
Fariborz Jahanian | 2e2acec | 2010-08-21 00:10:36 +0000 | [diff] [blame] | 40 | private: |
| 41 | long _value; |
| 42 | }; |
| 43 | |
Argyrios Kyrtzidis | 42d0f2a | 2010-08-23 07:12:16 +0000 | [diff] [blame] | 44 | void f() { |
| 45 | Wrapper w; |
| 46 | w[0]; |
| 47 | *w; |
| 48 | w->*(0); |
| 49 | } |