https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115814
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-07-07 Summary|class template argument |variadic template class |deduction failed in C++20 |deduction failure Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Just to show this is not lambda related here is a non-lambda version: ``` struct a{}; struct b{}; template<class... Ts> struct overloaded : Ts... { }; int main() { auto s = overloaded(a{}, b{}); } ``` Note it works with non-variadic templates though: ``` struct a{}; struct b{}; template<class Ts, class T2> struct overloaded : Ts, T2 { }; int main() { auto s = overloaded(a{}, b{}); } ```