http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46538
Summary: [4.3/4.4./4.5/4.6 Regression] ICE: SIGSEGV in cp_make_fname_decl (decl.c:3690) on invalid code when using __PRETTY_FUNCTION__ Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: zso...@seznam.cz ----- testcase.C ----- S():str(__PRETTY_FUNCTION__) {} ---------------------- Output with valgrind: $ gcc testcase.C testcase.C:1:3: error: ISO C++ forbids declaration of 'S' with no type [-fpermissive] testcase.C: In function 'int S()': testcase.C:1:5: error: only constructors take member initializers ==12873== Invalid read of size 1 ==12873== at 0x503CE7: cp_make_fname_decl (decl.c:3690) ==12873== by 0x662D44: fname_decl (c-common.c:856) ==12873== by 0x602FD5: finish_fname (semantics.c:2289) ==12873== by 0x5A7DA3: cp_parser_primary_expression (parser.c:3781) ==12873== by 0x5A7FBF: cp_parser_postfix_expression (parser.c:5137) ==12873== by 0x5A8C7B: cp_parser_unary_expression (parser.c:6109) ==12873== by 0x5A95D7: cp_parser_binary_expression (parser.c:6779) ==12873== by 0x5A9ADA: cp_parser_assignment_expression (parser.c:6995) ==12873== by 0x5ABBAE: cp_parser_parenthesized_expression_list (parser.c:5703) ==12873== by 0x5B1C7B: cp_parser_ctor_initializer_opt_and_function_body (parser.c:10667) ==12873== by 0x5B24B1: cp_parser_function_definition_after_declarator (parser.c:19647) ==12873== by 0x5B3C9B: cp_parser_init_declarator (parser.c:19576) ==12873== Address 0x74 is not stack'd, malloc'd or (recently) free'd ==12873== cc1plus: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r166868 - crash 3.3.6, 4.1.2, 4.2.4, 4.3.5, 4.4.5, 4.5.1 - bails out (release/no checking) 3.4.6, 4.0.4 - OK (release/no checking)