Debian Codegraph @

gcc/testsuite/gfortran.dg/allocate_with_source_4.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR 58916: [F03] Allocation of scalar with array source not rejected
4 !
5 ! Contributed by Vladimir Fuka <[email protected]>
6
7 class(*), allocatable :: a1
8 real, allocatable :: a2
9 real b(1)
10 allocate(a1, source=b) ! { dg-error "must be scalar or have the same rank" }
11 allocate(a2, source=b) ! { dg-error "must be scalar or have the same rank" }
12 end