https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84558

            Bug ID: 84558
           Summary: [6/7/8 Regression] ICE with invalid constexpr
                    constructor
           Product: gcc
           Version: 8.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
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 6.1.0.
The code was accepted in GCC 5.x.0 (compiled with "-std=c++1y"):

==============================
struct A
{
  static int i;
  constexpr A() { i = 0; }
};

struct B
{
  A a[2][1][1];
};

B b;
==============================

bug.cc:12:3:   in 'constexpr' expansion of 'b.B::B()'
bug.cc:12:3: internal compiler error: Segmentation fault
 B b;
   ^
0xeb1ddf crash_signal
        ../../gcc/gcc/toplev.c:325
0x8567af contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/gcc/tree.h:3245
0x8567af cxx_eval_vec_init_1
        ../../gcc/gcc/cp/constexpr.c:2981
0x852665 cxx_eval_vec_init
        ../../gcc/gcc/cp/constexpr.c:3011
0x852665 cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4535
0x854f1d cxx_eval_store_expression
        ../../gcc/gcc/cp/constexpr.c:3685
0x8525cf cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4248
0x852b6f cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4552
0x851697 cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4296
0x851697 cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4296
0x85162d cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4647
0x850aaf cxx_eval_call_expression
        ../../gcc/gcc/cp/constexpr.c:1689
0x85164b cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:4170
0x856c97 cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/constexpr.c:4819
0x859c28 maybe_constant_init_1
        ../../gcc/gcc/cp/constexpr.c:5145
0x8cd1ca expand_default_init
        ../../gcc/gcc/cp/init.c:1901
0x8cd1ca expand_aggr_init_1
        ../../gcc/gcc/cp/init.c:2004
0x8cd3d9 build_aggr_init(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/init.c:1744
0x8820ef build_aggr_init_full_exprs
        ../../gcc/gcc/cp/decl.c:6188
0x8820ef check_initializer
        ../../gcc/gcc/cp/decl.c:6337
Please submit a full bug report, [etc.]

Reply via email to