This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49598] Ice on lambda with implicit capture by value.
- From: "3dw4rd at verizon dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Jun 2011 20:44:08 +0000
- Subject: [Bug c++/49598] Ice on lambda with implicit capture by value.
- Auto-submitted: auto-generated
- References: <bug-49598-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49598
--- Comment #1 from Ed Smith-Rowland <3dw4rd at verizon dot net> 2011-06-30 20:43:39 UTC ---
Reduced testcase:
-----------------------------------------
int
main()
{
int i = 10;
int& ir = i;
[=] // [i, ir] explicit capture works.
{
i == ir;
}();
}
-----------------------------------------
With [=, ir] I get a warning:
lamb3.cpp:10:7: warning: explicit by-copy capture of âirâ redundant with
by-copy capture default [enabled by default]
But it compiles.
With [=, i] I get the ICE.