// RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s template class X> struct A; // expected-note 2{{previous template template parameter is here}} template class X> struct B; // expected-note{{previous template template parameter is here}} template class X> struct C; // expected-note 2{{previous non-type template parameter with type 'int' is here}} template struct X; // expected-note{{too few template parameters in template template argument}} template struct Y; // expected-note{{template parameter has a different kind in template argument}} template struct Ylong; // expected-note{{template non-type parameter has a different type 'long' in template argument}} template struct Yref; // expected-note{{template non-type parameter has a different type 'const int &' in template argument}} namespace N { template struct Z; } template struct TooMany; // expected-note{{too many template parameters in template template argument}} A *a1; A *a2; A< ::N::Z> *a3; A *a4; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}} A *a5; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}} B *a6; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}} C *a7; C *a8; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}} C *a9; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}} template void f(int); A *a9; // expected-error{{must be a class template}} // Evil digraph '<:' is parsed as '[', expect error. A<::N::Z> *a10; #if __cplusplus <= 199711L // expected-error@-2 {{found '<::' after a template name which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?}} #endif // Do not do a digraph correction here. A<: :N::Z> *a11; // expected-error{{expected expression}} \ expected-error{{C++ requires a type specifier for all declarations}} // PR7807 namespace N { template struct X { }; template struct Y { X const_ref(); }; template class TT, typename T, int N> int operator<<(int, TT a) { // expected-note{{candidate template ignored}} 0 << a.const_ref(); // expected-error{{invalid operands to binary expression ('int' and 'X')}} } void f0( Y y){ 1 << y; } // expected-note{{in instantiation of function template specialization 'N::operator<<' requested here}} } // PR12179 template class F> #if __cplusplus <= 199711L // expected-warning@-2 {{variadic templates are a C++11 extension}} #endif struct unbox_args { typedef typename Primitive::template call x; }; template