// 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{{missing 'template' keyword prior to dependent template name 'T::apply'}} template struct X2 : vector { }; // expected-error{{unknown template name '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 'struct PR6031::FI2'}} \ // expected-error{{C++ requires a type specifier for all declarations}} }; 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{{'Nested' does not name a tag member in the specified scope}} typedef typename NoDepBase::template MemberTemplate::type type; // expected-error{{'MemberTemplate' following the 'template' keyword does not refer to a template}} \ // FIXME: expected-error{{expected an identifier or template-id after '::'}} \ // FIXME: expected-error{{unqualified-id}} return NoDepBase::a; // expected-error{{no member named 'a' in 'struct PR6031::NoDepBase'}} } }; } namespace Ambig { template struct Base1 { typedef int type; // expected-note{{member found by ambiguous name lookup}} }; struct Base2 { typedef float type; // expected-note{{member 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}} }