blob: 49ba9bcd3d9d1fb627d6e0b65dd1503608508c62 [file] [log] [blame]
! { dg-do compile }
!
! Tests correction to implementation of pointer function assignments.
!
! Contributed by Mikael Morin <mikael.morin@sfr.fr>
!
program p
integer, target :: a(3) = 2
integer :: b(3, 3) = 1
integer :: c
c = 3
func (b(2, 2)) = b ! { dg-error "Incompatible ranks 1 and 2 in assignment" }
func (c) = b ! { dg-error "Incompatible ranks 1 and 2 in assignment" }
contains
function func(arg) result(r)
integer, pointer :: r(:)
integer :: arg
if (arg == 1) then
r => a
else
r => null()
end if
end function func
end program p