aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/associate_10.f90
blob: 53b055447b1fe7168ca3c61b3f573da347ea7dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do compile }
!
! PR fortran/51383
!
! Contributed by kaiserkarl31@yahoo.com
!
! Was failing before at the ref resolution of y1(1)%i.
!
program extend
   type :: a
      integer :: i
   end type a
   type, extends (a) :: b
      integer :: j
   end type b
   type (a) :: x(2)
   type (b) :: y(2)
   associate (x1 => x, y1 => y)
      x1(1)%i = 1
      ! Commenting out the following line will avoid the error
      y1(1)%i = 2
   end associate
end program extend