aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
blob: ed4f9dd053211521e022a26dcae9ecd69cf967d1 (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
! { dg-do compile }

! PR fortran/41615
! Output nicer error message for invalid assumed-len character function result
! depending on what kind of contained procedure it is.

module funcs
   implicit none
contains
      function assumed_len(x) ! { dg-error "module procedure" }
         character(*) assumed_len
         integer, intent(in) :: x
      end function assumed_len
end module funcs

module mod2
  implicit none
contains
  subroutine mysub ()
    contains
      function assumed_len(x) ! { dg-error "internal function" }
         character(*) assumed_len
         integer, intent(in) :: x
      end function assumed_len
  end subroutine
end module mod2

program main
  implicit none
contains
      function assumed_len(x) ! { dg-error "internal function" }
         character(*) assumed_len
         integer, intent(in) :: x
      end function assumed_len
end program main