http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58965

            Bug ID: 58965
           Summary: [4.8/4.9 Regression] [c++11] ICE with member
                    initializer in static union
           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 valid code snippet (compiled with "-std=c++11") triggers an ICE
since GCC 4.8.0:

=====================
void foo()
{
  static union
  {
    int i = i;
  };
}
=====================

bug.cc: In function 'void foo()':
bug.cc:6:4: internal compiler error: Segmentation fault
   };
    ^
0xb2d0df crash_signal
        ../../gcc/gcc/toplev.c:334
0x713c15 tree_check
        ../../gcc/gcc/tree.h:2691
0x713c15 write_guarded_var_name
        ../../gcc/gcc/cp/mangle.c:3791
0x713e36 mangle_guard_variable(tree_node*)
        ../../gcc/gcc/cp/mangle.c:3807
0x6214bb get_guard(tree_node*)
        ../../gcc/gcc/cp/decl2.c:2739
0x577865 expand_static_init
        ../../gcc/gcc/cp/decl.c:6965
0x577865 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6500
0x58a928 shadow_tag(cp_decl_specifier_seq*)
        ../../gcc/gcc/cp/decl.c:4389
0x6655a1 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11142
0x6492e0 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10945
0x64a403 cp_parser_declaration_statement
        ../../gcc/gcc/cp/parser.c:10592
0x64aa77 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9333
0x64b779 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9611
0x64b8ee cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9565
0x65eefb cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18418
0x65eefb cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18454
0x6632ef cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22465
0x6640c2 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22386
0x6640c2 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16429
0x66533f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11064
Please submit a full bug report, [etc.]

The code was correctly accepted in GCC 4.7.0.

Reply via email to