// RUN: %clang_cc1 -verify %s -std=c++11 template struct A { template struct B; template using C = U; // expected-note {{here}} }; struct X { template X(T); struct Y { template Y(T); }; }; template A // expected-error {{missing 'typename' prior to dependent type template name 'A::B'}} ::B f1(); template A::C f2(); // expected-error {{missing 'typename' prior to dependent type template name 'A::C'}} // FIXME: Should these cases really be valid? There doesn't appear to be a rule prohibiting them... template A::C::X(T) {} template A::C::X::Y::Y(T) {} // FIXME: This is ill-formed template int A::B::*f3() {} template int A::C::*f4() {} // FIXME: This is valid template int A::template C::*f5() {} // expected-error {{has no members}} template template struct A::B { friend A::C f6(); // ok, same as 'friend T f6();' // FIXME: Error recovery here is awful; we decide that the template-id names // a type, and then complain about the rest of the tokens, and then complain // that we didn't get a function declaration. friend A::C f7(); // expected-error {{use 'template' keyword to treat 'C' as a dependent template name}} expected-error 3{{}} friend A::template C f8(); // expected-error 4{{}} };