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

--- Comment #2 from janus at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #0)
> The following code (minus the IF condition) shows that _vptr is not set for
> the allocatable component:
>         y.x._data = 0B;
> there should be - but isn't - additionally: y.x._vptr = &__vtab_m_T;

Without the BLOCK, the dump shows:

  static struct t2 y = {.x={._vptr=&__vtab_m_T}};

  y.x._data = 0B;
  y.ii = 123;

while with the BLOCK one gets:

    struct t2 y;

    try
      {
        y.x._data = 0B;
        y.ii = 123;
        L.1:;
      }

Can't we do a 'static' initialization (of _vptr *and* _data) in both cases? As
in

  struct t2 y = {.x={._vptr=&__vtab_m_T,._data = 0B}}

For this gfc_class_null_initializer (from class.c) could be used ...

Reply via email to