This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77890] New: class template type deduction fails for lambda functions
- From: "jeff.mirwaisi at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Oct 2016 23:56:52 +0000
- Subject: [Bug c++/77890] New: class template type deduction fails for lambda functions
- Auto-submitted: auto-generated
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([]{});
}