https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87284
--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> --- Author: pault Date: Wed Sep 12 18:53:50 2018 New Revision: 264251 URL: https://gcc.gnu.org/viewcvs?rev=264251&root=gcc&view=rev Log: 2018-09-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/87284 * trans-expr.c (gfc_trans_class_init_assign): Access to to array elements of the dynamic type requires that the array reference be added to the class expression and not the _data component, unlike scalar expressions. 2018-09-12 Paul Thomas <pa...@gcc.gnu.org> PR fortran/87284 * gfortran.dg/allocate_with_mold_2.f90: New test. Added: branches/gcc-8-branch/gcc/testsuite/gfortran.dg/allocate_with_mold_2.f90 Modified: branches/gcc-8-branch/gcc/fortran/ChangeLog branches/gcc-8-branch/gcc/fortran/trans-expr.c branches/gcc-8-branch/gcc/testsuite/ChangeLog