1! { dg-do compile }
2!
3! PR 42048: [F03] Erroneous syntax error message on TBP call
4!
5! Contributed by Damian Rouson <rouson@sandia.gov>
6
7module grid_module
8 implicit none
9 type grid
10 contains
11   procedure :: new_grid
12 end type
13contains
14 subroutine new_grid(this)
15   class(grid) :: this
16 end subroutine
17end module
18
19module field_module
20 use grid_module
21 implicit none
22
23 type field
24   type(grid) :: mesh
25 end type
26
27contains
28
29 type(field) function new_field()
30  call new_field%mesh%new_grid()
31 end function
32
33 function new_field2() result(new)
34  type(field) :: new
35  call new%mesh%new_grid()
36 end function
37
38 type(field) function new_field3()
39  call g()
40 contains
41  subroutine g()
42    call new_field3%mesh%new_grid()
43  end subroutine g
44 end function new_field3
45
46end module
47