This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/77890] New: class template type deduction fails for lambda functions


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([]{});
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]