http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58835
Bug ID: 58835 Summary: [4.7/4.8/4.9 Regression] ICE with __PRETTY_FUNCTION__ in broken function 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 code snippet triggers an ICE since GCC 4.1.0: ================================================================= struct A { int i; template<typename> void foo() : i(__PRETTY_FUNCTION__) {} }; ================================================================= bug.cc: In member function 'void A::foo()': bug.cc:4:35: error: only constructors take member initializers template<typename> void foo() : i(__PRETTY_FUNCTION__) {} ^ bug.cc:4:37: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in finish_fname, at cp/semantics.c:2540 template<typename> void foo() : i(__PRETTY_FUNCTION__) {} ^ 0xd17204 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.c:9473 0x6c8723 contains_struct_check ../../gcc/gcc/tree.h:2788 0x6c8723 finish_fname(tree_node*) ../../gcc/gcc/cp/semantics.c:2540 0x64ce78 cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:4370 0x64df70 cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:5865 0x6506fd cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7066 0x6512cf cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:7758 0x6517af cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:7996 0x652f38 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:8046 0x652f38 cp_parser_parenthesized_expression_list ../../gcc/gcc/cp/parser.c:6584 0x65e461 cp_parser_mem_initializer ../../gcc/gcc/cp/parser.c:12216 0x65e461 cp_parser_mem_initializer_list ../../gcc/gcc/cp/parser.c:12100 0x65e461 cp_parser_ctor_initializer_opt ../../gcc/gcc/cp/parser.c:12069 0x65e461 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:18429 0x6625df cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22452 0x669e30 cp_parser_late_parsing_for_member ../../gcc/gcc/cp/parser.c:23117 0x645391 cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19180 0x645391 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19204 0x645391 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14151 0x65d90f cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11396 Please submit a full bug report, [etc.]