aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/deferred_type_proc_pointer_2.f90
blob: dbdb3bdba34eccd0601649d07edf74b7c6f55ca1 (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
! { dg-do compile }
!
! PR fortran/45170
! PR fortran/52158

module test
 implicit none
 type t
   procedure(deferred_len), pointer, nopass :: ppt
 end type t
contains
 function deferred_len()
   character(len=:), allocatable :: deferred_len
   deferred_len = 'abc'
 end function deferred_len
 subroutine doIt()
   type(t) :: x
   character(:), allocatable :: temp
   x%ppt => deferred_len
   temp = deferred_len()
   if ("abc" /= temp) call abort()
 end subroutine doIt
end module test

use test
call doIt ()
end