blob: 0d2fc06dc35ac827ab677a34e43a8e3b4c3ee00e [file] [log] [blame]
John McCallc0008342010-05-13 07:48:05 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3@class NSString;
4
5// Reduced from WebKit.
6namespace test0 {
7 template <typename T> struct RemovePointer {
8 typedef T Type;
9 };
10
11 template <typename T> struct RemovePointer<T*> {
12 typedef T Type;
13 };
14
15 template <typename T> struct RetainPtr {
16 typedef typename RemovePointer<T>::Type ValueType;
17 typedef ValueType* PtrType;
18 RetainPtr(PtrType ptr);
19 };
20
21 void test(NSString *S) {
22 RetainPtr<NSString*> ptr(S);
23 }
John McCall5d7c29a2010-05-13 08:39:13 +000024
25 void test(id S) {
26 RetainPtr<id> ptr(S);
27 }
John McCallc0008342010-05-13 07:48:05 +000028}