1! { dg-do compile }
2!
3! PR fortran/47042
4!
5! Contribued by Jerry DeLisle
6!
7
8program bug
9
10contains
11function get_cstring ()
12  character              :: get_cstring
13  character, pointer     :: ptmp
14  character, allocatable :: atmp
15
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" }
18end function
19
20function get_cstring2 ()
21  EXTERNAL :: ptmp, atmp
22  character              :: get_cstring2
23  character, pointer     :: ptmp
24  character, allocatable :: atmp
25
26  get_cstring2 = atmp(i) ! { dg-error "must have an explicit function interface" }
27
28  ! The following is regarded as call to a procedure pointer,
29  ! which is in principle valid:
30  get_cstring2 = ptmp(i)
31end function
32
33end program
34