| 1 |
! { dg-do compile } |
| 2 |
! { dg-options -std=f95 } |
| 3 |
! |
| 4 |
! Code was posted to comp.lang.fortran by Richard Maine. |
| 5 |
! http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/fff9b3426211c018# |
| 6 |
! |
| 7 |
module m |
| 8 |
type :: foo |
| 9 |
real, pointer :: array(:) |
| 10 |
procedure (), pointer, nopass :: f ! { dg-error "Procedure pointer component" } |
| 11 |
end type |
| 12 |
contains |
| 13 |
elemental subroutine fooAssgn (a1, a2) |
| 14 |
type(foo), intent(out) :: a1 |
| 15 |
type(foo), intent(in) :: a2 |
| 16 |
allocate (a1%array(size(a2%array))) |
| 17 |
|
| 18 |
a1%array = a2%array |
| 19 |
a1%f => a2%f ! { dg-error "not a member of the" } |
| 20 |
end subroutine |
| 21 |
end module m |