http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60251
Bug ID: 60251 Summary: [4.9 Regression] [c++11] ICE capturing variable-length array Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code snippet (compiled with "-std=c++11") triggers an ICE on trunk: ==================================== void foo(int n) { int x[n]; [&x]() { decltype(x) y; }; } ==================================== bug.cc: In lambda function: bug.cc:4:21: internal compiler error: in is_normal_capture_proxy, at cp/lambda.c:258 [&x]() { decltype(x) y; }; ^ 0x7a28d0 is_normal_capture_proxy(tree_node*) ../../gcc/gcc/cp/lambda.c:258 0x7a69bc is_lambda_ignored_entity(tree_node*) ../../gcc/gcc/cp/lambda.c:1076 0x77b6ef qualify_lookup ../../gcc/gcc/cp/name-lookup.c:4270 0x7805fc lookup_name_real_1 ../../gcc/gcc/cp/name-lookup.c:4798 0x7805fc lookup_name_real(tree_node*, int, int, bool, int, int) ../../gcc/gcc/cp/name-lookup.c:4883 0x6a1276 cp_parser_lookup_name ../../gcc/gcc/cp/parser.c:22231 0x6b37b2 cp_parser_lookup_name_simple ../../gcc/gcc/cp/parser.c:22294 0x6b37b2 cp_parser_decltype_expr ../../gcc/gcc/cp/parser.c:11854 0x6b37b2 cp_parser_decltype ../../gcc/gcc/cp/parser.c:12003 0x6cb40f cp_parser_simple_type_specifier ../../gcc/gcc/cp/parser.c:14533 0x6a942d cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14380 0x6c2b40 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11547 0x6c9739 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11137 0x6acc03 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11086 0x6add21 cp_parser_declaration_statement ../../gcc/gcc/cp/parser.c:10733 0x6ae36b cp_parser_statement ../../gcc/gcc/cp/parser.c:9467 0x6af159 cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9745 0x6b07ce cp_parser_lambda_body ../../gcc/gcc/cp/parser.c:9249 0x6b07ce cp_parser_lambda_expression ../../gcc/gcc/cp/parser.c:8757 0x6b07ce cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:4305 Please submit a full bug report, [etc.] The code compiles fine, if I capture '[&]' instead of '[&x]'.