| 1 |
! { dg-do compile } |
| 2 |
! Tests the fix for PR38765 in which the use associated symbol |
| 3 |
! 'fun' was confused with the contained function in 'mod_b' |
| 4 |
! because the real name was being used instead of the 'use' |
| 5 |
! name.. |
| 6 |
! |
| 7 |
! Contributed by Paul Thomas <[email protected]> |
| 8 |
! from a report by Marco Restelli. |
| 9 |
! |
| 10 |
module mod_a |
| 11 |
implicit none |
| 12 |
public :: fun |
| 13 |
private |
| 14 |
contains |
| 15 |
pure function fun(x) result(mu) |
| 16 |
real, intent(in) :: x(:,:) |
| 17 |
real :: mu(2,2,size(x,2)) |
| 18 |
mu = 2.0 |
| 19 |
end function fun |
| 20 |
end module mod_a |
| 21 |
|
| 22 |
module mod_b |
| 23 |
use mod_a, only: & |
| 24 |
a_fun => fun |
| 25 |
implicit none |
| 26 |
private |
| 27 |
contains |
| 28 |
pure function fun(x) result(mu) |
| 29 |
real, intent(in) :: x(:,:) |
| 30 |
real :: mu(2,2,size(x,2)) |
| 31 |
mu = a_fun(x) |
| 32 |
end function fun |
| 33 |
end module mod_b |