http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50437

             Bug #: 50437
           Summary: [C++0x] [4.7 regression] ICE for trivial use of lambda
                    in template function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zeratul...@hotmail.com


The following trivial use of a lambda in a template function:

template <typename T>
void f()
{
    auto g = [](T t){ return t == 0; };
    g(T());
}

int main()
{
    f<int>();
}

Gives the following ICE with GCC 4.7.0-20110910:

test.cpp: In instantiation of 'void f() [with T = int]':
test.cpp:10:12:   required from here
test.cpp:5:5: internal compiler error: in cxx_incomplete_type_diagnostic, at
cp/typeck2.c:459

GCC 4.6.1 compiles the code successfully.

Reply via email to