aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/typebound_call_11.f03
blob: fa3693e726e645a600bb368e17850a6bf023095c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
! { dg-do compile }
!
! PR 42048: [F03] Erroneous syntax error message on TBP call
!
! Contributed by Damian Rouson <rouson@sandia.gov>

module grid_module
 implicit none
 type grid
 contains
   procedure :: new_grid
 end type
contains
 subroutine new_grid(this)
   class(grid) :: this
 end subroutine
end module

module field_module
 use grid_module
 implicit none

 type field
   type(grid) :: mesh
 end type

contains

 type(field) function new_field()
  call new_field%mesh%new_grid()
 end function

 function new_field2() result(new)
  type(field) :: new
  call new%mesh%new_grid()
 end function

 type(field) function new_field3()
  call g()
 contains
  subroutine g()
    call new_field3%mesh%new_grid()
  end subroutine g
 end function new_field3

end module