Debian Codegraph @

gcc/testsuite/gfortran.dg/pr42051.f03

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/42051
4 ! PR fortran/44064
5 ! Access to freed symbols
6 !
7 ! Testcase provided by Damian Rouson <[email protected]>,
8 ! reduced by Janus Weil <[email protected]>.
9
10 module grid_module
11 implicit none
12 type grid
13 end type
14 type field
15 type(grid) :: mesh
16 end type
17 contains
18 real function return_x(this)
19 class(grid) :: this
20 end function
21 end module
22
23 module field_module
24 use grid_module, only: field,return_x
25 implicit none
26 contains
27 subroutine output(this)
28 class(field) :: this
29 print *,return_x(this%mesh)
30 end subroutine
31 end module
32
33 end