// RUN: clang-cc -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}} #if 0 // FIXME: parse template declarations in these scopes, so that we can // complain about the one at function scope. class X { public: template class C; }; void f() { template class X; } #endif