| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR 45366: Problem with procedure pointer dummy in PURE function |
| 4 |
! |
| 5 |
! Contributed by Marco Restelli <[email protected]> |
| 6 |
|
| 7 |
module m1 |
| 8 |
implicit none |
| 9 |
abstract interface |
| 10 |
pure function i_f(x) result(y) |
| 11 |
real, intent(in) :: x |
| 12 |
real :: y |
| 13 |
end function i_f |
| 14 |
end interface |
| 15 |
end module m1 |
| 16 |
|
| 17 |
module m2 |
| 18 |
use m1, only: i_f |
| 19 |
implicit none |
| 20 |
contains |
| 21 |
pure function i_g(x,p) result(y) |
| 22 |
real, intent(in) :: x |
| 23 |
procedure(i_f), pointer, intent(in) :: p |
| 24 |
real :: y |
| 25 |
y = p(x) |
| 26 |
end function i_g |
| 27 |
end module m2 |