This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49598] [C++0x] Ice on lambda with implicit capture by value.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 2 Jul 2011 11:26:10 +0000
- Subject: [Bug c++/49598] [C++0x] 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
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.02 11:25:48
CC| |jason at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-02 11:25:48 UTC ---
The ICE seems to be when initialising the closure type's data member for an
object of reference type implicitly-captured by copy.
Slightly further reduced:
int
main()
{
int i = 10;
int& ir = i;
[=]
{
(void) ir;
}();
}
(In reply to comment #1)
> 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.
That's invalid:
"If a lambda-capture includes a capture-default that is =, the lambda-capture
shall not contain this and each identiïer it contains shall be preceded by &."