diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2017-11-05 14:32:05 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2017-11-05 14:32:05 +0000 |
commit | 5233d45559d5869fe7dc9705d6c79e6538d8a2ab (patch) | |
tree | 4312d6964f57222d5150f716ba8439e6ef4da776 /gcc/fortran/resolve.c | |
parent | aea5e9327a49bc73878a547d490bb32ac31df03e (diff) | |
download | gcc-5233d45559d5869fe7dc9705d6c79e6538d8a2ab.zip gcc-5233d45559d5869fe7dc9705d6c79e6538d8a2ab.tar.gz gcc-5233d45559d5869fe7dc9705d6c79e6538d8a2ab.tar.bz2 |
re PR fortran/78641 ([OOP] ICE on polymorphic allocatable function in array constructor)
2017-11-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78641
* resolve.c (resolve_ordinary_assign): Do not add the _data
component for class valued array constructors being assigned
to derived type arrays.
* trans-array.c (gfc_trans_array_ctor_element): Take the _data
of class valued elements for assignment to derived type arrays.
2017-11-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78641
* gfortran.dg/class_66.f90: New test.
From-SVN: r254428
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 50b4b49..1dde0d3 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -10324,7 +10324,8 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) /* Assign the 'data' of a class object to a derived type. */ if (lhs->ts.type == BT_DERIVED - && rhs->ts.type == BT_CLASS) + && rhs->ts.type == BT_CLASS + && rhs->expr_type != EXPR_ARRAY) gfc_add_data_component (rhs); bool caf_convert_to_send = flag_coarray == GFC_FCOARRAY_LIB |