// RUN: %clang_cc1 -fsyntax-only -verify %s template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; template struct metafun_apply2 { typedef typename MetaFun::template apply inner; typedef typename inner::type type; }; template struct pair; struct make_pair { template struct apply { typedef pair type; }; }; int a0[is_same::type, pair >::value? 1 : -1]; int a1[is_same< typename make_pair::template apply, make_pair::apply >::value? 1 : -1]; template struct swap_and_apply2 { template struct apply { typedef typename MetaFun::template apply new_metafun; typedef typename new_metafun::type type; }; }; int a2[is_same::apply::type, pair >::value? 1 : -1]; template struct swap_and_apply2b { template struct apply { typedef typename MetaFun::template apply::type type; }; }; int a3[is_same::apply::type, pair >::value? 1 : -1]; template struct X0 { template struct Inner; void f0(X0::Inner); // expected-note{{here}} void f0(typename X0::Inner); // expected-error{{redecl}} void f1(X0::Inner); // expected-note{{here}} void f1(typename X0::template Inner); // expected-error{{redecl}} void f2(typename X0::Inner::type); // expected-note{{here}} void f2(typename X0::template Inner::type); // expected-error{{redecl}} }; namespace PR6236 { template struct S { }; template struct S { template struct K { }; void f() { typedef typename S::template K Foo; } }; } namespace PR6268 { template struct Outer { template struct Inner {}; template typename Outer::template Inner foo(typename Outer::template Inner); }; template template typename Outer::template Inner Outer::foo(typename Outer::template Inner) { return Inner(); } } namespace PR6463 { struct B { typedef int type; }; // expected-note 2{{member found by ambiguous name lookup}} struct C { typedef int type; }; // expected-note 2{{member found by ambiguous name lookup}} template struct A : B, C { type& a(); // expected-error{{found in multiple base classes}} int x; }; // FIXME: Improve source location info here. template typename A::type& A::a() { // expected-error{{found in multiple base classes}} return x; // expected-error{{undeclared identifier}} } }