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

            Bug ID: 58609
           Summary: [4.9 Regression] [c++11] ICE with uninitialized
                    variable in 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 (since at least GCC 4.9.0 20130920):

===================================
struct A
{
  static constexpr int&& i = 0;
};

int j = A::i;
===================================

bug.cc:3:30: error: non-constant in-class initialization invalid for static
member 'A::i'
   static constexpr int&& i = 0;
                              ^
bug.cc:3:30: error: (an out of class initialization is required)
cc1plus: internal compiler error: in record_reference, at cgraphbuild.c:66
0x7ff843 record_reference
        ../../gcc/gcc/cgraphbuild.c:66
0xcf44ab walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node*
(*)(tree_node**, int*, void*), void*, pointer_set_t*))
        ../../gcc/gcc/tree.c:10928
0xcf48e5 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node*
(*)(tree_node**, int*, void*), void*, pointer_set_t*))
        ../../gcc/gcc/tree.c:11191
0x8001fd record_references_in_initializer(tree_node*, bool)
        ../../gcc/gcc/cgraphbuild.c:427
0xd2ce67 varpool_analyze_node(varpool_node*)
        ../../gcc/gcc/varpool.c:398
0x804147 analyze_functions
        ../../gcc/gcc/cgraphunit.c:1035
0x805669 finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2260
0x6188a0 cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4360
Please submit a full bug report, [etc.]

Reply via email to