[Fortran] ICE: Invalid expression in gfc_element_size PR93601
authorMark Eggleston <markeggleston@gcc.gnu.org>
Tue, 18 Feb 2020 14:15:41 +0000 (14:15 +0000)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Tue, 18 Feb 2020 14:15:41 +0000 (14:15 +0000)
commit23d3f25c87d307536f7e0f15e211968a87657602
treef1a38ab5169c3ccb426df0042d1b9e2b8000a93a
parent08afe87b7976e93197a66e01f93191ead496ad42
[Fortran] ICE: Invalid expression in gfc_element_size PR93601

ICE occurs when assigning a BOZ constant to an class(*) variable
with the allocatable attribute. Use of BOZ constants outside
data statements and int/real/dble/cmplx intrinsics is not allowed.

Original patch provided by Steven G. Kargl  <kargl@gcc.gnu.org>.

gcc/fortran/ChangeLog

PR fortran/93601
* match.c (gfc_match_assignment) : Reject assignment if
the lhs stype is BT_CLASS and the rhs type is BT_BOZ.

gcc/testsuite/ChangeLog

PR fortran/93601
* gfortran.dg/pr93601.f90 : New test.
gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr93601.f90 [new file with mode: 0644]