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

             Bug #: 50939
           Summary: [C++0x] lambda expression causes ICE when lambda
                    captures const variable and odr-uses the variable in
                    function templates
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: gwt...@gmail.com


Compiling the following code generates ICE:
===
template <typename T>
void foo(T x)
{
    int const a = x;
    [&]{ return &a; }();
}

int main()
{
    foo(100);
}
===
$ g++ -std=c++0x lambda.cc
lambda.cc: In lambda function:
lambda.cc:5:21: internal compiler error: in make_decl_rtl, at varasm.c:1163
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
===

Reply via email to