// RUN: %clang_cc1 -std=c++11 -verify %s template struct X {}; template struct P {}; namespace Nested { template int f1(X... a); // expected-note +{{conflicting types for parameter 'T'}} template int f2(P, T> ...a); // expected-note +{{conflicting types for parameter 'T'}} int a1 = f1(X(), X()); int a2 = f1(X()); int a3 = f1(X(), X()); // expected-error {{no matching}} int a4 = f1(X(), X()); // expected-error {{no matching}} int a5 = f1(X(), X()); // expected-error {{no matching}} int a6 = f1(X(), X(), X()); // expected-error {{no matching}} int b1 = f2(P, int>(), P, double>()); int b2 = f2(P, int>(), P, double>(), P, char>()); // expected-error {{no matching}} } namespace PR14841 { template struct A {}; template void f(A); // expected-note {{substitution failure [with Ts = ]: too many template arg}} void g(A a) { f(a); f(a); f(a); f(a); // expected-error {{no matching function}} } } namespace RetainExprPacks { int f(int a, int b, int c); template struct X {}; template int g(X, decltype(f(Ts()...))); int n = g(X(), 0); } namespace PR14615 { namespace comment0 { template struct X {}; template struct X { typedef int type; struct valid {}; }; template , typename = typename T::valid> typename T::type check(int); int i = check(1); } namespace comment2 { template struct X; template ::type I = 0> char check(B...); // expected-note {{undefined template 'PR14615::comment2::X'}} void f() { check(1, 2); } // expected-error {{no matching function}} } namespace comment3 { template struct X; template ::type I = (typename X::type)0> char check(B...); // expected-note {{undefined template 'PR14615::comment3::X'}} void f() { check(1, 2); } // expected-error {{no matching function}} } }