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

            Bug ID: 60225
           Summary: [4.9 Regression] [c++11] ICE initializing constexpr
                    array
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          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 on trunk:

==========================================
struct A
{
  constexpr A() {}
  static constexpr A a[2] = {};
};
==========================================

bug.cc:4:30: internal compiler error: in literal_type_p, at cp/semantics.c:7365
   static constexpr A a[2] = {};
                              ^
0x737157 literal_type_p(tree_node*)
        ../../gcc/gcc/cp/semantics.c:7365
0x7388bd ensure_literal_type_for_constexpr_object(tree_node*)
        ../../gcc/gcc/cp/semantics.c:7386
0x5d8ebf cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6206
0x6865e6 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
        ../../gcc/gcc/cp/decl2.c:985
0x6a611f cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:20429
0x6a9724 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:19976
0x6a9724 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19210
0x6a9724 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
0x6a9724 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14302
0x6c2ba0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c9799 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11137
0x6acc63 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6d3f12 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d2c08 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6d44aa cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d44aa c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f3813 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Reply via email to