// RUN: %clang_cc1 -fsyntax-only -verify %s template struct X0 : T::template apply { X0(U u) : T::template apply(u) { } }; template struct X1 : T::apply { }; // expected-error{{use 'template' keyword to treat 'apply' as a dependent template name}} template struct X2 : vector { }; // expected-error{{no template named 'vector'}} namespace PR6031 { template struct A; template struct C { }; template struct II { typedef typename A::type type; }; template struct FI : II { C a; }; template struct FI2 { C a; // expected-error{{no type named 'type' in 'FI2'}} }; template struct Base { class Nested { }; template struct MemberTemplate { }; int a; }; template struct HasDepBase : Base { int foo() { class HasDepBase::Nested nested; typedef typename HasDepBase::template MemberTemplate::type type; return HasDepBase::a; } }; template struct NoDepBase { int foo() { class NoDepBase::Nested nested; // expected-error{{no class named 'Nested' in 'NoDepBase'}} typedef typename NoDepBase::template MemberTemplate::type type; // expected-error{{no member named 'MemberTemplate' in 'NoDepBase'}} return NoDepBase::a; // expected-error{{no member named 'a' in 'NoDepBase'}} } }; } namespace Ambig { template struct Base1 { typedef int type; // expected-note{{member type 'int' found by ambiguous name lookup}} }; struct Base2 { typedef float type; // expected-note{{member type 'float' found by ambiguous name lookup}} }; template struct Derived : Base1, Base2 { typedef typename Derived::type type; // expected-error{{member 'type' found in multiple base classes of different types}} type *foo(float *fp) { return fp; } }; Derived di; // expected-note{{instantiation of}} } namespace PR6081 { template struct A { }; template class B : public A { public: template< class X > void f0(const X & k) { this->template f1()(k); } }; template class C { public: template< class X > void f0(const X & k) { this->template f1()(k); // expected-error{{no member named 'f1' in 'C'}} } }; } namespace PR6413 { template class Base_A { }; class Base_B { }; template class Derived : public virtual Base_A , public virtual Base_B { }; } namespace PR5812 { template struct Base { Base* p; }; template struct Derived: public Base { typename Derived::Base* p; // meaning Derived::Base }; Derived di; }