| 1 |
! { dg-do compile } |
| 2 |
! PR fortran/20858 |
| 3 |
! If we have "x = null(i)", then "null()" acquires the type, kind type, |
| 4 |
! and rank of i and these need to match those of x. |
| 5 |
program null_1 |
| 6 |
integer, parameter :: sp = kind(1.e0), dp = kind(1.d0) |
| 7 |
integer, pointer :: i => null() |
| 8 |
real(sp), pointer :: x => null() |
| 9 |
real(dp), pointer :: y => null() |
| 10 |
real(sp), pointer :: z(:) => null() |
| 11 |
x => null(i) ! { dg-error "types in pointer assignment" } |
| 12 |
x => null(y) ! { dg-error "types in pointer assignment" } |
| 13 |
z => null(i) ! { dg-error "types in pointer assignment" } |
| 14 |
z => null(y) ! { dg-error "types in pointer assignment" } |
| 15 |
x => null(z) ! { dg-error "ranks in pointer assignment" } |
| 16 |
z => null(x) ! { dg-error "ranks in pointer assignment" } |
| 17 |
z => null(z) |
| 18 |
nullify(i, x, y, z) |
| 19 |
end program null_1 |