[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / interface_34.f90
blob880f179e6f0616db694ec7a7b30825be08387612
1 ! { dg-do compile }
3 ! PR fortran/47042
5 ! Contribued by Jerry DeLisle
8 program bug
10 contains
11 function get_cstring ()
12 character :: get_cstring
13 character, pointer :: ptmp
14 character, allocatable :: atmp
16 get_cstring = ptmp(i) ! { dg-error "must have an explicit function interface" }
17 get_cstring = atmp(i) ! { dg-error "must have an explicit function interface" }
18 end function
20 function get_cstring2 ()
21 EXTERNAL :: ptmp, atmp
22 character :: get_cstring2
23 character, pointer :: ptmp
24 character, allocatable :: atmp
26 get_cstring2 = atmp(i) ! { dg-error "must have an explicit function interface" }
28 ! The following is regarded as call to a procedure pointer,
29 ! which is in principle valid:
30 get_cstring2 = ptmp(i)
31 end function
33 end program