[Bug c++/58812] New: [4.7/4.8/4.9 Regression] ICE initializing an r-value reference with an initializer list

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Oct 19 23:21:00 GMT 2013


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

            Bug ID: 58812
           Summary: [4.7/4.8/4.9 Regression] ICE initializing an r-value
                    reference with an initializer list
           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 (compiled with "-std=c++11") triggers an ICE
since GCC 4.7.0:

===================
int i;
int&& j{{ i }};
===================

bug.cc:2:14: internal compiler error: in build_target_expr, at cp/tree.c:316
 int&& j{{ i }};
              ^
0x6e488f build_target_expr
        ../../gcc/gcc/cp/tree.c:310
0x54f981 convert_like_real
        ../../gcc/gcc/cp/call.c:6205
0x5552e6 initialize_reference(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:9306
0x56207e grok_reference_init
        ../../gcc/gcc/cp/decl.c:4769
0x56207e check_initializer
        ../../gcc/gcc/cp/decl.c:5637
0x574b6c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6356
0x662737 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16640
0x663e7f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11054
0x6477e0 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10935
0x66e9fe cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10832
0x66d71a cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10718
0x66f036 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3990
0x66f036 c_parse_file()
        ../../gcc/gcc/cp/parser.c:30970
0x78be93 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]



More information about the Gcc-bugs mailing list