// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s template struct pair { }; template struct tuple { }; template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; namespace ExpandIntoFixed { template, typename W = V*> class X0 { }; template class X1 { public: typedef X0 type; }; static_assert(is_same::type, X0, pair*>>::value, "fails with two default arguments"); static_assert(is_same::type, X0>::value, "fails with one default argument"); static_assert(is_same::type, X0>::value, "fails with no default arguments"); } namespace ExpandIntoFixedShifted { template, typename W = V*> class X0 { }; template class X1 { public: typedef X0 type; }; static_assert(is_same::type, X0, pair*>>::value, "fails with two default arguments"); static_assert(is_same::type, X0>::value, "fails with one default argument"); static_assert(is_same::type, X0>::value, "fails with no default arguments"); } namespace Deduction { template struct Foo {}; template tuple &foo(Foo); void call_foo(Foo foo_if, Foo foo_i) { tuple &t1 = foo(foo_if); tuple &t2 = foo(foo_i); } } namespace PR9021a { template struct A { }; template struct B { A a1; }; void test() { B c; } } namespace PR9021b { template struct t2 { }; template class M> struct m { template using inner = M; }; m sta2; } namespace PartialSpecialization { template struct X0; // expected-note 2{{template is declared here}} template struct X0 { // expected-error {{class template partial specialization is not more specialized than the primary template}} }; X0 x0i; // expected-error{{too few template arguments for class template 'X0'}} X0 x0if; X0 x0ifd; } namespace FixedAliasTemplate { template struct S {}; template using U = S; // expected-note 2{{template parameter is declared here}} template U &f(U, Ts...); // expected-error 2{{pack expansion used as argument for non-pack parameter of alias template}} S &s1 = f({}, 0, 0.0); // expected-error {{no matching function}} } namespace PR18401 { template struct foo { }; template using bar = foo; // expected-note 2{{template parameter is declared here}} expected-note {{'bar' declared here}} template using baz = bar; // expected-error {{pack expansion used as argument for non-pack parameter of alias template}} // FIXME: We should still record the alias template, but mark it as invalid. template void f(baz); // expected-error {{no template named 'baz'; did you mean 'bar'}} expected-error {{pack expansion used as argument for non-pack}} void g() { f(foo()); } // expected-error {{no matching function}} }