OSDN Git Service

2009-11-26 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / typebound_call_11.f03
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
7 module grid_module
8  implicit none
9  type grid
10  contains
11    procedure :: new_grid
12  end type
13 contains
14  subroutine new_grid(this)
15    class(grid) :: this
16  end subroutine
17 end module
18
19 module field_module
20  use grid_module
21  implicit none
22
23  type field
24    type(grid) :: mesh
25  end type
26
27 contains
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
46 end module
47
48 ! { dg-final { cleanup-modules "grid_module field_module" } }