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++/49598] New: Ice on lambda with implicit capture by value.


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

           Summary: Ice on lambda with implicit capture by value.
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: 3dw4rd@verizon.net


I have a brand new (r175707) 4.7 build on x86_64 GNU/Linux.

I saw an error with lambdas on stackoverflow:
-----------------------------------------------
#include <iostream>

using std::cout;
using std::endl;

int
main()
{
  int i = 10;
  int& ir = i;

  [=] // [i, ir] explicit capture works.
  {
      cout << "value capture" << endl
           << "i: " << i << endl
           << "ir: " << ir << endl
           << "&i: " << &i << endl
           << "&ir: " << &ir << endl
           << endl;
  }();
}
-----------------------------------------------

This is reduced somewhat.

I get:
-----------------------------------------------
[ed@localhost ~]$ ./bin/bin/g++ -std=c++0x -o lamb2 lamb2.cpp
lamb2.cpp: In function âint main()â:
lamb2.cpp:10:1: error: non-trivial conversion at assignment
int
int &
D.28407.__ir = ir;

lamb2.cpp:10:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
-----------------------------------------------


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