From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../SemaObjCXX/pointer-to-objc-pointer-conv.mm | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 clang/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm (limited to 'clang/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm') diff --git a/clang/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm b/clang/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm new file mode 100644 index 0000000..d0f8404 --- /dev/null +++ b/clang/test/SemaObjCXX/pointer-to-objc-pointer-conv.mm @@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +@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]; + +} + + +// 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; } + + Wrapper &operator*(); + Wrapper &operator[](int); + Wrapper& operator->*(int); + +private: + long _value; +}; + +void f() { + Wrapper w; + w[0]; + *w; + w->*(0); +} -- cgit v1.2.3