| 1 |
! { dg-do compile } |
| 2 |
! PR 83012 - this was incorrectly rejected. |
| 3 |
! Original test case by Neil Carlson. |
| 4 |
module mod |
| 5 |
type :: foo |
| 6 |
integer, pointer, contiguous :: p(:) |
| 7 |
contains |
| 8 |
procedure :: dataptr |
| 9 |
end type |
| 10 |
contains |
| 11 |
function dataptr(this) result(dp) |
| 12 |
class(foo), intent(in) :: this |
| 13 |
integer, pointer, contiguous :: dp(:) |
| 14 |
dp => this%p |
| 15 |
end function |
| 16 |
end module |
| 17 |
|
| 18 |
subroutine bar(x) |
| 19 |
use mod |
| 20 |
class(foo) :: x |
| 21 |
integer, pointer, contiguous :: p(:) |
| 22 |
p => x%dataptr() |
| 23 |
end subroutine |