blob: 7ada2f4239a10781507100af7fee63bf8a867d1a [file] [log] [blame]
Fariborz Jahanian42ffdb32010-01-18 22:59:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbsc6e68da2012-10-19 12:44:48 +00002// expected-no-diagnostics
Fariborz Jahanian42ffdb32010-01-18 22:59:22 +00003
NAKAMURA Takumid05b01a2012-11-19 10:00:59 +00004// REQUIRES: LP64
5
Fariborz Jahanian42ffdb32010-01-18 22:59:22 +00006@interface G
7@end
8
9@interface F
10- (void)bar:(id *)objects;
11- (void)foo:(G**)objects;
12@end
13
14
15void a() {
16 F *b;
17 G **keys;
18 [b bar:keys];
19
20 id *PID;
21 [b foo:PID];
22
23}
24
Fariborz Jahaniane4151b52010-08-21 00:10:36 +000025
26// pr7936
27@interface I1 @end
28
29class Wrapper {
30public:
31 operator id() const { return (id)_value; }
32 operator Class() const { return (Class)_value; }
33 operator I1*() const { return (I1*)_value; }
34
35 bool Compare(id obj) { return *this == obj; }
36 bool CompareClass(Class obj) { return *this == obj; }
37 bool CompareI1(I1* obj) { return *this == obj; }
38
Argyrios Kyrtzidis421ad5e2010-08-23 07:12:16 +000039 Wrapper &operator*();
40 Wrapper &operator[](int);
41 Wrapper& operator->*(int);
42
Fariborz Jahaniane4151b52010-08-21 00:10:36 +000043private:
44 long _value;
45};
46
Argyrios Kyrtzidis421ad5e2010-08-23 07:12:16 +000047void f() {
48 Wrapper w;
49 w[0];
50 *w;
51 w->*(0);
52}