// 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; // expected-note{{has a different type 'int'}} template class X> // expected-error{{cannot have type 'float'}} \ // expected-note{{with type 'long'}} struct X0 { }; X0 x0b1; X0 x0b2; // expected-note{{while substituting}} X0 x0b3; // expected-error{{template template argument has different template parameters}} template class TT> // expected-note{{parameter with type 'int'}} struct X1 { }; template class TT> struct X2 { X1 x1; // expected-error{{has different template parameters}} }; template struct X3i { }; template struct X3l { }; // expected-note{{different type 'long'}} X2 x2okay; X2 x2bad; // expected-note{{instantiation}} 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_; }; }