This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56401] New: Lambda's this pointer are not initialized inside template classes
- From: "gonzalobg88 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Feb 2013 20:37:29 +0000
- Subject: [Bug c++/56401] New: Lambda's this pointer are not initialized inside template classes
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56401
Bug #: 56401
Summary: Lambda's this pointer are not initialized inside
template classes
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gonzalobg88@gmail.com
Created attachment 29502
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29502
The first lambda produces a warning. It compiles but the program behaves wrong.
The second lambda crashes the compiler.
Compiling with: "g++-4.7.2 -std=c++11 -Wall -Wextra"
The first lambda produces the following warnign:
"warning: missing initializer for member âB<D>::foo() [with D =
void]::lambda()>::__thisâ [-Wmissing-field-initializers]"
It recognizes that it has to capture the this pointer, but it does not
initialize it. The code compiles and the executable does not print 10 as it
should.
The second lambda crashes gcc with the following error:
"internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1035"