Code for triggering the BUG: float nested_lambda() { float val; [val]() { [val]() { } } } float nested_lambda() nested_lambda()::<lambda()> <stdin>:7:4: internal compiler error: Szegmens hiba Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. according to gdb, the segfault originates at: cp/semantics.c:2814, and it's a null pointer dereferencing. After a bit of inspection, it was revealed that in the code: decl = add_default_capture (lambda_stack, llambda_stack is NULL. I tried the code: float nested_lambda() { float val; [val]() { float val2 = val; [val2]() { } } } which seems to be working fine.
Let's CC Jason here too, being an issue with lambda...
*** Bug 42738 has been marked as a duplicate of this bug. ***
Subject: Bug 41896 Author: jason Date: Wed Feb 10 22:45:07 2010 New Revision: 156673 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156673 Log: PR c++/41896 * semantics.c (outer_lambda_capture_p): Use current_function_decl instead of current_class_type. Added: trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested3.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Fixed.
Subject: Bug 41896 Author: jason Date: Thu Feb 11 02:12:53 2010 New Revision: 156678 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156678 Log: PR c++/41896 * semantics.c (outer_lambda_capture_p): Revert. (add_capture): Only finish_member_declaration if we're in the lambda class. (register_capture_members): New. * cp-tree.h: Declare it. * parser.c (cp_parser_lambda_expression): Call it. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/cp/semantics.c