2010-01-19 06:59:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2010-01-19 06:59:22 +08:00
|
|
|
|
2012-11-19 18:00:59 +08:00
|
|
|
// REQUIRES: LP64
|
|
|
|
|
2010-01-19 06:59:22 +08:00
|
|
|
@interface G
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface F
|
|
|
|
- (void)bar:(id *)objects;
|
|
|
|
- (void)foo:(G**)objects;
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
void a() {
|
|
|
|
F *b;
|
|
|
|
G **keys;
|
|
|
|
[b bar:keys];
|
|
|
|
|
|
|
|
id *PID;
|
|
|
|
[b foo:PID];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-08-21 08:10:36 +08:00
|
|
|
|
|
|
|
// pr7936
|
|
|
|
@interface I1 @end
|
|
|
|
|
|
|
|
class Wrapper {
|
|
|
|
public:
|
|
|
|
operator id() const { return (id)_value; }
|
|
|
|
operator Class() const { return (Class)_value; }
|
|
|
|
operator I1*() const { return (I1*)_value; }
|
|
|
|
|
|
|
|
bool Compare(id obj) { return *this == obj; }
|
|
|
|
bool CompareClass(Class obj) { return *this == obj; }
|
|
|
|
bool CompareI1(I1* obj) { return *this == obj; }
|
|
|
|
|
2010-08-23 15:12:16 +08:00
|
|
|
Wrapper &operator*();
|
|
|
|
Wrapper &operator[](int);
|
|
|
|
Wrapper& operator->*(int);
|
|
|
|
|
2010-08-21 08:10:36 +08:00
|
|
|
private:
|
|
|
|
long _value;
|
|
|
|
};
|
|
|
|
|
2010-08-23 15:12:16 +08:00
|
|
|
void f() {
|
|
|
|
Wrapper w;
|
|
|
|
w[0];
|
|
|
|
*w;
|
|
|
|
w->*(0);
|
|
|
|
}
|