| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/47042 |
| 4 |
! |
| 5 |
! Contribued by Jerry DeLisle |
| 6 |
! |
| 7 |
|
| 8 |
program bug |
| 9 |
|
| 10 |
contains |
| 11 |
function 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" } |
| 18 |
end function |
| 19 |
|
| 20 |
function 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) |
| 31 |
end function |
| 32 |
|
| 33 |
end program |