| 1 |
! { dg-do compile } |
| 2 |
! Tests the fix for PR27709 in which the specification expression on |
| 3 |
! line 22 was not resolved because of the multiple component references. |
| 4 |
! |
| 5 |
! Contributed by David Ham <[email protected]> |
| 6 |
! |
| 7 |
module elements |
| 8 |
implicit none |
| 9 |
type element_type |
| 10 |
type(ele_numbering_type), pointer :: numbering |
| 11 |
end type element_type |
| 12 |
type ele_numbering_type |
| 13 |
integer, dimension(:,:), pointer :: number2count |
| 14 |
end type ele_numbering_type |
| 15 |
end module elements |
| 16 |
module global_numbering |
| 17 |
use elements |
| 18 |
implicit none |
| 19 |
contains |
| 20 |
function element_local_coords(element) result (coords) |
| 21 |
type(element_type), intent(in) :: element |
| 22 |
real, dimension(size(element%numbering%number2count, 1)) :: coords |
| 23 |
coords=0.0 |
| 24 |
end function element_local_coords |
| 25 |
end module global_numbering |
| 26 |
|
| 27 |
use global_numbering |
| 28 |
type (element_type) :: e |
| 29 |
type (ele_numbering_type), target :: ent |
| 30 |
allocate (ent%number2count (2,2)) |
| 31 |
e%numbering => ent |
| 32 |
print *, element_local_coords (e) |
| 33 |
end |