// RUN: %clang_cc1 -fsyntax-only -verify %s template struct A {}; // Check for template argument lists followed by junk // FIXME: The diagnostics here aren't great... A int x; // expected-error {{expected '>'}} expected-error {{expected unqualified-id}} A'}} // PR8912 template struct S {}; S 1)> s; // Test behavior when a template-id is ended by a token which starts with '>'. namespace greatergreater { template struct S { S(); S(T); }; void f(S=0); // expected-error {{a space is required between a right angle bracket and an equals sign (use '> =')}} void f(S>=S()); // expected-error {{use '> >'}} expected-error {{use '> ='}} template void t(); void g() { void (*p)() = &t; (void)(&t==p); // expected-error {{use '> ='}} (void)(&t>=p); // expected-error {{use '> >'}} (void)(&t>>=p); // expected-error {{use '> >'}} (void)(&t>==p); // expected-error {{use '> >'}} expected-error {{use '> ='}} } } namespace PR5925 { template class foo { // expected-note {{here}} }; void bar(foo *X) { // expected-error {{requires template arguments}} } } namespace PR13210 { template class C {}; // expected-note {{here}} void f() { new C(); // expected-error {{requires template arguments}} } } // Don't emit spurious messages namespace pr16225add { template struct Known { }; // expected-note 3 {{template is declared here}} template struct X; template struct ABC; // expected-note {{template is declared here}} template struct ABC2 {}; template struct foo : UnknownBase // expected-error {{unknown template name 'UnknownBase'}} { }; template struct foo2 : UnknownBase, // expected-error {{unknown template name 'UnknownBase'}} Known // expected-error {{too few template arguments for class template 'Known'}} { }; template struct foo3 : UnknownBase > // expected-error {{unknown template name 'UnknownBase'}} { }; template struct foo4 : UnknownBase >, // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{too few template arguments for class template 'ABC'}} Known // expected-error {{too few template arguments for class template 'Known'}} { }; template struct foo5 : UnknownBase> // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{use '> >'}} { }; template struct foo6 : UnknownBase>, // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{use '> >'}} Known // expected-error {{too few template arguments for class template 'Known'}} { }; template struct foo7 : UnknownBase1)> // expected-error {{unknown template name 'UnknownBase'}} { }; template struct foo8 : UnknownBase,X> // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{use '> >'}} { }; template struct foo9 : UnknownBase,X> // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{use '> >'}} { }; template struct foo10 : UnknownBase,X>> // expected-error {{unknown template name 'UnknownBase'}} \ // expected-error {{use '> >'}} { }; template struct foo11 : UnknownBase<2 // expected-error {{unknown template name 'UnknownBase'}} { }; }