https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36961
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- For completeness, trunk says this for the reduced testcase in comment 7: d.cc: In function ‘int main()’: d.cc:17:12: error: no matching function for call to ‘f(foo)’ f(foo()); ^ d.cc:12:6: note: candidate: template<template<class> class Temp1, template<template<class> class<template-parameter-2-1> > class Temp2> void f(Temp2<Temp1>) void f(Temp2<Temp1> v); ^ d.cc:12:6: note: template argument deduction/substitution failed: d.cc:17:12: note: can't deduce a template for ‘Temp2<Temp1>’ from non-template type ‘foo’ f(foo()); ^