diff options
author | Harald Anlauf <anlauf@gmx.de> | 2022-10-09 20:43:32 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2022-10-14 22:16:57 +0200 |
commit | 89f20c9ae4641f9b2e87e47f7dab3dc197faa0aa (patch) | |
tree | eb59194934bc7d22c0af1d85722278ca08d95e4b /gcc/testsuite | |
parent | b4a4c6382b14bc107d6d95ff809f3e9cd71944e7 (diff) | |
download | gcc-89f20c9ae4641f9b2e87e47f7dab3dc197faa0aa.zip gcc-89f20c9ae4641f9b2e87e47f7dab3dc197faa0aa.tar.gz gcc-89f20c9ae4641f9b2e87e47f7dab3dc197faa0aa.tar.bz2 |
Fortran: fix check of polymorphic elements in data transfers [PR100971]
gcc/fortran/ChangeLog:
PR fortran/100971
* resolve.cc (resolve_transfer): Extend check for permissibility
of polymorphic elements in a data transfer to arrays.
gcc/testsuite/ChangeLog:
PR fortran/100971
* gfortran.dg/der_io_5.f90: New test.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/gfortran.dg/der_io_5.f90 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/der_io_5.f90 b/gcc/testsuite/gfortran.dg/der_io_5.f90 new file mode 100644 index 0000000..193916c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/der_io_5.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! PR fortran/100971 - ICE: Bad IO basetype (7) +! Contributed by G.Steinmetz + +program p + implicit none + type t + end type + class(t), allocatable :: a, b(:) + type(t) :: x, y(1) + integer :: i + allocate (a,b(1)) + print *, [a] ! { dg-error "Data transfer element at .1. cannot be polymorphic" } + print *, [(b(i),i=1,1)] ! { dg-error "Data transfer element at .1. cannot be polymorphic" } + print *, [x] + print *, [(y(i),i=1,1)] +end |