summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
blob: 49d1a2e55dd2e19f5a38300feb57db0cfd7c2b98 (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
! { 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

! { dg-final { cleanup-modules "funcs mod2" } }