http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60190
Bug ID: 60190 Summary: [c++1y] ICE with invalid return type of template lambda Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid line of code (compiled with "-std=c++1y") triggers an ICE on trunk: ====================================== auto f = []<int>() -> int() {}; ====================================== bug.cc:1:27: error: 'operator()' declared as function returning a function auto f = []<int>() -> int() {}; ^ bug.cc:1:29: internal compiler error: in poplevel_class, at cp/name-lookup.c:2951 auto f = []<int>() -> int() {}; ^ 0x77d247 poplevel_class() ../../gcc/gcc/cp/name-lookup.c:2951 0x6626b8 popclass() ../../gcc/gcc/cp/class.c:7127 0x67756d finish_struct(tree_node*, tree_node*) ../../gcc/gcc/cp/class.c:6808 0x6b08a7 cp_parser_lambda_expression ../../gcc/gcc/cp/parser.c:8768 0x6b08a7 cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:4305 0x6b20ed cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:5971 0x6b50c6 cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7170 0x6b5def cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:7874 0x6b62e1 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:8112 0x6b67a5 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:8162 0x6b67a5 cp_parser_constant_expression ../../gcc/gcc/cp/parser.c:8372 0x6c82ce cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16758 0x6c9929 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11205 0x6acc13 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11086 0x6d3ec2 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10983 0x6d2bb8 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10869 0x6d445a cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4014 0x6d445a c_parse_file() ../../gcc/gcc/cp/parser.c:31536 0x7f37c3 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1060 Please submit a full bug report, [etc.]