1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 // Reduced from WebKit.
7 template <typename T> struct RemovePointer {
11 template <typename T> struct RemovePointer<T*> {
15 template <typename T> struct RetainPtr {
16 typedef typename RemovePointer<T>::Type ValueType;
17 typedef ValueType* PtrType;
18 RetainPtr(PtrType ptr);
21 void test(NSString *S) {
22 RetainPtr<NSString*> ptr(S);
31 @protocol Test1Protocol;
33 template <typename T> struct RemovePointer {
36 template <typename T> struct RemovePointer<T*> {
39 template <typename A, typename B> struct is_same {};
40 template <typename A> struct is_same<A,A> {
43 template <typename T> struct tester {
45 is_same<T, typename RemovePointer<T>::type*>::foo(); // expected-error 2 {{no member named 'foo'}}
49 template struct tester<id>;
50 template struct tester<id<Test1Protocol> >;
51 template struct tester<Class>;
52 template struct tester<Class<Test1Protocol> >;
53 template struct tester<Test1Class*>;
54 template struct tester<Test1Class<Test1Protocol>*>;
56 template struct tester<Test1Class>; // expected-note {{in instantiation}}
57 template struct tester<Test1Class<Test1Protocol> >; // expected-note {{in instantiation}}
61 template <typename T> void foo(const T* t) {}