Fix the clang-wpa example.
[clang.git] / test / SemaObjCXX / conversion-to-objc-pointer.mm
blob235aaac8d09cdb3277b23613fd9574e686447ff6
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // rdar: // 7963410
4 template<class T>
5 class TNSAutoRef
7 public:
8         TNSAutoRef(T t)
9                 :       fRef(t)
10                 { }
12         ~TNSAutoRef()
13                 {  }
15         operator T() const
16                 { return fRef; }
17         
18         T Get() const
19                 { return fRef; }
21 private:
22         T fRef;
25 @interface NSObject
26 - (id) alloc;
27 - (id)init;
28 @end
30 @interface TFoo : NSObject
31 - (void) foo;
32 @end
34 @implementation TFoo
35 - (void) foo {}
36 @end
38 @interface TBar : NSObject
39 - (void) foo;
40 @end
42 @implementation TBar 
43 - (void) foo {}
44 @end
46 int main () {
47         TNSAutoRef<TBar*> bar([[TBar alloc] init]);
48         [bar foo];
49         return 0;