// RUN: %clang_cc1 -fsyntax-only -verify %s class A; class S { public: template struct A { struct Nested { typedef T type; }; }; }; int i; S::A::Nested::type *ip = &i; template struct Outer { template class Inner0; template class Inner1 { struct ReallyInner; T foo(U); template T bar(V); template T* bar(V); static T value1; static U value2; }; }; template template class Outer::Inner0 { public: void f(X, Y); }; template template void Outer::Inner0::f(X, Y) { } template template struct Outer::Inner1::ReallyInner { static Y value3; void g(X, Y); }; template template void Outer::Inner1::ReallyInner::g(X, Y) { } template template X Outer::Inner1::foo(Y) { return X(); } template template template X Outer::Inner1::bar(Z) { return X(); } template template template X* Outer::Inner1::bar(Z) { return 0; } template template X Outer::Inner1::value1 = 0; template template Y Outer::Inner1::value2 = Y(); template template Y Outer::Inner1::ReallyInner::value3 = Y(); template template Y Outer::Inner1::ReallyInner::value4; // expected-error{{Outer::Inner1::ReallyInner::}} template struct X0 { }; template struct X0 { template void f(U u = T()) { } }; // PR5103 template struct X1 { template struct B { }; }; template struct X1::B; // Template template parameters template struct X2 { template class> // expected-error{{cannot have type 'float'}} \ // expected-note{{previous non-type template}} struct Inner { }; }; template // expected-note{{template non-type parameter}} struct X2_arg; X2::Inner x2i1; X2 x2a; // expected-note{{instantiation}} X2::Inner x2i3; // expected-error{{template template argument has different}} namespace PR10896 { template class Foo { public: void foo() {} private: template T SomeField; // expected-error {{member 'SomeField' declared as a template}} }; void g() { Foo f; f.foo(); } } namespace PR10924 { template< class Topology, class ctype > struct ReferenceElement { }; template< class Topology, class ctype > template< int codim > class ReferenceElement< Topology, ctype > :: BaryCenterArray // expected-error{{out-of-line definition of 'BaryCenterArray' does not match any declaration in 'ReferenceElement'}} { }; }