// RUN: %clang_cc1 -fsyntax-only -verify %s @class NSString; // Reduced from WebKit. namespace test0 { template struct RemovePointer { typedef T Type; }; template struct RemovePointer { typedef T Type; }; template struct RetainPtr { typedef typename RemovePointer::Type ValueType; typedef ValueType* PtrType; RetainPtr(PtrType ptr); }; void test(NSString *S) { RetainPtr ptr(S); } void test(id S) { RetainPtr ptr(S); } } @class Test1Class; @protocol Test1Protocol; namespace test1 { template struct RemovePointer { typedef T type; }; template struct RemovePointer { typedef T type; }; template struct is_same {}; template struct is_same { static void foo(); }; template struct tester { void test() { is_same::type*>::foo(); // expected-error 2 {{no member named 'foo'}} } }; template struct tester; template struct tester >; template struct tester; template struct tester >; template struct tester; template struct tester*>; template struct tester; // expected-note {{in instantiation}} template struct tester >; // expected-note {{in instantiation}} } namespace test2 { template void foo(const T* t) {} void test(id x) { foo(x); } }