http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45873
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-16 12:01:31 UTC --- Jason, should deduction succeed here? template<class, class> struct pair { template<class T1, class U1> pair(T1&& t, U1&& u) { } }; template <template <class...> class T, class ...Args> auto foo(Args... args) -> T<Args...> { return T<Args...>(args...); } int main() { // error: no matching function for call to 'foo(int, double)' foo<pair>(1, 2.0); } It looks as though substituting T=pair fails because T's single parameter pack fails to match pair's two parameters. If pair is a variadic template with exactly one parameter pack , like p0 below, then it matches T: template<class...> struct p0 { }; template<class, class...> struct p1 { }; template<class, class, class...> struct p2 { }; template <template <class...> class T, class ...Args> auto foo(Args... args) -> T<Args...> { return T<Args...>(); } int main() { foo<p0>(1, 2.0); // ok foo<p1>(1, 2.0); // error foo<p2>(1, 2.0); // error } Is this behaviour correct? Clang accepts all three calls