https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84651

--- Comment #2 from Vegard Nossum <vegard.nossum at gmail dot com> ---
Related test case/crash:

void a() {
  struct {
    void b(float) struct b = 0;
    void b();
  } x;
}

int b;

Gives:

xgcc -x c++ -S  -
<stdin>: In function 'void a()':
<stdin>:3:17: error: expected ';' at end of member declaration
<stdin>:3:28: error: expected unqualified-id before '=' token
<stdin>: At global scope:
<stdin>:8:5: internal compiler error: Segmentation fault
0x3156909 crash_signal
        /home/vegard/git/gcc/gcc/toplev.c:325
0xe219f2 outer_binding(tree_node*, cxx_binding*, bool)
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:5879
0xe5cbc9 lookup_name_real_1
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:6002
0xe5cbc9 lookup_name_real(tree_node*, int, int, bool, int, int)
        /home/vegard/git/gcc/gcc/cp/name-lookup.c:6103
0xc45fb7 find_last_decl
        /home/vegard/git/gcc/gcc/cp/decl2.c:1463
0xc45fb7 cplus_decl_attributes(tree_node**, tree_node*, int)
        /home/vegard/git/gcc/gcc/cp/decl2.c:1545
0xc1a30a start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        /home/vegard/git/gcc/gcc/cp/decl.c:5044
0xfa3b9c cp_parser_init_declarator
        /home/vegard/git/gcc/gcc/cp/parser.c:19598
0xfa99d7 cp_parser_simple_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:13063
0xfafbc8 cp_parser_block_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12881
0x1002545 cp_parser_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12778
0xff9d9b cp_parser_declaration_seq_opt
        /home/vegard/git/gcc/gcc/cp/parser.c:12654
0xffb3c3 cp_parser_translation_unit
        /home/vegard/git/gcc/gcc/cp/parser.c:4561
0xffb3c3 c_parse_file()
        /home/vegard/git/gcc/gcc/cp/parser.c:38993
0x15a7105 c_common_parse_file()
        /home/vegard/git/gcc/gcc/c-family/c-opts.c:1132

Reply via email to