aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr102112.f90
blob: 72057907297c91785ce76acc8ed718ecb441a088 (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 }
!
! Contributed by Brad Richardson  <everythingfunctional@protonmail.com>
!
program main
    implicit none

    type :: sub_t
        integer :: val
    end type

    type :: obj_t
        type(sub_t) :: sub_obj
    end type

    associate(initial_sub => sub_t(42))
        associate(obj => obj_t(initial_sub))
            associate(sub_obj => obj%sub_obj)
                if (sub_obj%val .ne. 42) stop 1
            end associate
        end associate
    end associate
end program