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

            Bug ID: 58966
           Summary: [4.9 Regression] [c++11] ICE with wrong usage of
                    constexpr
           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
on trunk:

===========================
struct A
{
  constexpr int i;
};

constexpr A a[] = {};
===========================

bug.cc:3:17: error: non-static data member 'i' declared 'constexpr'
   constexpr int i;
                 ^
bug.cc:6:20: internal compiler error: in cxx_eval_bare_aggregate, at
cp/semantics.c:8840
 constexpr A a[] = {};
                    ^
0x6ddbe9 cxx_eval_bare_aggregate
        ../../gcc/gcc/cp/semantics.c:8840
0x6ddbe9 cxx_eval_constant_expression
        ../../gcc/gcc/cp/semantics.c:9620
0x6df206 cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/semantics.c:9727
0x5ee9b3 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/gcc/cp/typeck2.c:786
0x5639d6 check_initializer
        ../../gcc/gcc/cp/decl.c:5737
0x57686d cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6356
0x663bd1 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16650
0x66533f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11064
0x6492e0 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10945
0x6705e7 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10842
0x66f308 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10728
0x670c46 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3990
0x670c46 c_parse_file()
        ../../gcc/gcc/cp/parser.c:31002
0x791113 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]

The regression was introduced between 4.9.0 20131023 and 4.9.0 20131025.

Reply via email to