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

            Bug ID: 93676
           Summary: crash in build_value_init
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: spambait at maniek dot info
  Target Milestone: ---

The following code crashes the compiler (most versions on compiler explorer,
e.g. current trunk, or 7.4).

//------------------------------
struct point{
    int x=0;
};

typedef point array_t[1];

template<class T>
struct s{
    s(){
        new array_t[2];
    }
};
//------------------------------


error message:
<source>: In constructor 's<T>::s()':
<source>:10:22: internal compiler error: in build_value_init, at cp/init.c:349

   10 |         new array_t[2];

      |                      ^


url:
https://godbolt.org/z/vTonHP

Reply via email to