// RUN: %clang_cc1 -fsyntax-only -verify %s template class A; extern "C++" { template class B; } namespace N { template class C; } extern "C" { template class D; // expected-error{{templates must have C++ linkage}} } template class A; // expected-note{{previous template declaration is here}} template class A; // expected-error{{template parameter has a different kind in template redeclaration}} template class NonTypeTemplateParm; typedef int INT; template class NonTypeTemplateParm; // expected-note{{previous non-type template parameter with type 'INT' (aka 'int') is here}} template class NonTypeTemplateParm; // expected-error{{template non-type parameter has a different type 'long' in template redeclaration}} template class X> class TemplateTemplateParm; template class Y> class TemplateTemplateParm; // expected-note{{previous template declaration is here}} \ // expected-note{{previous template template parameter is here}} template class TemplateTemplateParm; // expected-error{{template parameter has a different kind in template redeclaration}} template class X> class TemplateTemplateParm; // expected-error{{too many template parameters in template template parameter redeclaration}} template struct test {}; // expected-note{{previous definition}} template struct test : T {}; // expected-error{{redefinition}} class X { public: template class C; }; void f() { template class X; // expected-error{{expression}} } template class X1 var; // expected-error{{declared as a template}} namespace M { } template class M::C3 { }; // expected-error{{out-of-line definition of 'C3' does not match any declaration in namespace 'M'}} namespace PR8001 { template struct Foo { template class Bar; typedef Bar Baz; template struct Bar { Bar() {} }; }; void pr8001() { Foo::Baz x; Foo::Bar y(x); } } namespace rdar9676205 { template class tuple_element; template class pair; template class tuple_element<0, pair<_T1, _T2> > { template struct X { template ::value> struct Y : public X<_Up>, public Y<_Up> { }; }; }; }