// RUN: %clang_cc1 -fsyntax-only -verify %s template class MetaFun, typename Value> struct apply { typedef typename MetaFun::type type; }; template struct add_pointer { typedef T* type; }; template struct add_reference { typedef T& type; }; int i; apply::type ip = &i; apply::type ir = i; apply::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot bind to a value of unrelated type 'int'}} // Template template parameters template struct B; template class X> // expected-error{{cannot have type 'float'}} // expected-error@-1 {{cannot be narrowed from type 'long long' to 'int'}} // expected-note@-2 {{previous template template parameter is here}} struct X0 { }; X0 x0b1; X0 x0b2; // expected-note{{while substituting}} X0 x0b3; // expected-note {{has different template parameters}} template class TT> struct X1 { }; template class TT> struct X2 { X1 x1; }; template struct X3i { }; template struct X3l { }; X2 x2okay; X2 x2okay2; template class TT, class R = TT<1, 2> > struct Comp { typedef R r1; template struct gt { static const bool result = x > y; }; typedef gt<2, 1> r2; }; template struct lt { static const bool result = x < y; }; Comp c0; namespace PR8629 { template class TT> struct X0 { static void apply(); }; template struct Type { }; template struct X1 { template struct Inner; template void g() { typedef Inner Init; X0::apply(); } template void f () { g >(); } }; template template struct X1::Inner { template struct VeryInner { }; }; struct X1Container { X1Container() { simplex_.f<0>(); } X1 simplex_; }; }