Debian Codegraph @

gcc/testsuite/gfortran.dg/func_assign.f90

raw
1 ! { dg-do compile }
2 !
3 ! PR fortran/31559
4 ! Do not allow assigning to external functions
5 !
6 ! Contributed by Steve Kargl <[email protected]>
7 !
8 module mod
9 implicit none
10 contains
11 integer function bar()
12 bar = 4
13 end function bar
14
15 subroutine a()
16 implicit none
17 real :: fun
18 external fun
19 interface
20 function funget(a)
21 integer :: a
22 end function
23 subroutine sub()
24 end subroutine sub
25 end interface
26 sub = 'a' ! { dg-error "is not a variable" }
27 fun = 4.4 ! { dg-error "is not a variable" }
28 funget = 4 ! { dg-error "is not a variable" }
29 bar = 5 ! { dg-error "is not a variable" }
30 end subroutine a
31 end module mod
32
33 end