summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90
blob: b345c9d6bfe212552f6f8abd3c8c963d99c079d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! { dg-do compile }
! Tests the fix for PR35470, in which the pointer assignment would fail
! because the assumed size 'arr' would get mixed up with the component
! 'p' in the check for the upper bound of an assumed size array.
!
! Contributed by Antony Lewis <antony@cosmologist.info>
!
subroutine sub(arr)
  type real_pointer
    real, pointer :: p(:)
  end type real_pointer
  type(real_pointer), dimension(*) :: arr
  real, pointer :: p(:)
  p => arr(1)%p
end subroutine