1! { dg-do compile } 2! 3! PR 58916: [F03] Allocation of scalar with array source not rejected 4! 5! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com> 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" } 12end 13