https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77890
Bug ID: 77890 Summary: class template type deduction fails for lambda functions Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jeff.mirwaisi at gmail dot com Target Milestone: --- //error: 'S(F&&)-> S<F> [with F = main(int, char**)::<lambda()>]', declared using local //type 'main(int, char**)::<lambda()>', is used but never defined template<class F> struct S{S(F&&f){}}; int main() { S([]{}); } //explicit deduction via a helper function works as expected template<class F> struct S{S(F&&f){}}; template<class F> auto H(F&& f){return S<F>(forward<F&&>(f));} int main() { H([]{}); }