// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s // A default template-argument may be specified for any kind of // template-parameter that is not a template parameter pack. template // expected-error{{template parameter pack cannot have a default argument}} struct X0; template // expected-error{{template parameter pack cannot have a default argument}} struct X1; template struct vector; template class ...Templates = vector> // expected-error{{template parameter pack cannot have a default argument}} struct X2; struct X3 { template // expected-error{{default template argument not permitted on a friend template}} friend void f0(X3); template friend void f1(X3) { } }; namespace PR8748 { // Testcase 1 struct A0 { template struct B; }; template struct A0::B { }; // Testcase 2 template struct A1 { template struct B; }; template template struct A1::B { }; // expected-error{{cannot add a default template argument to the definition of a member of a class template}} // Testcase 3 template struct X2 { void f0(); template void f1(); }; template void X2::f0() { } // expected-error{{cannot add a default template argument to the definition of a member of a class template}} template template void X2::f1() { } // expected-error{{cannot add a default template argument to the definition of a member of a class template}} namespace Inner { template struct X3; template void f2(); } // Okay; not class members. template struct Inner::X3 { }; template void Inner::f2() {} } namespace PR10069 { template T f(T x); void g() { f(0); } }